durusmail: quixote-users: Quixote, Zope, Python2.1
Quixote, Zope, Python2.1
2003-02-08
2003-02-09
2003-02-09
2003-02-11
ANN: Generating REST-ful Quixote applications
2003-02-12
2003-02-13
2003-02-23
2003-02-24
2003-02-26
2003-03-05
Quixote, Zope, Python2.1
Neil Schemenauer
2003-02-08
On Sat, Feb 08, 2003 at 05:04:10AM -0600, Jeff Bauer wrote:
> I finally have an opportunity to consider using Quixote
> for some applications.  We're using a mangled subset
> of Zope, so our current production Python interpreter
> is 2.1.  Will Quixote 0.6 continue to support this version
> of Python?

I think if there is a demand we will maintain 2.1 compatibility.  It
hasn't been too much work so far.

> Also, this has probably already been reported, but when
> importing quixote in Python2.3:
>
> >>> import quixote
> /usr/local/lib/python2.3/site-packages/quixote/fcgi.py:162:
> FutureWarning: x< a long in Python 2.4 and up
>   _lowbits = ~(1 << 31) # everything but the highest bit
>
> /usr/local/lib/python2.3/site-packages/quixote/fcgi.py:178:
> FutureWarning: x< a long in Python 2.4 and up
>   _highbit = (1 << 31)

I knew about it but hadn't got around to fixing it.  Andrew, you may
want to add a section to "Porting" section in the "What's New" document
explaining how to deal with this warning.  For the high bit I think the
right fix is to make the 1 literal into a long.

    >>> 1 << 31
    -2147483648
    >>> 1L << 31
    2147483648L
    >>> struct.pack(">I", 1 << 31)
    '\x80\x00\x00\x00'
    >>> struct.pack(">I", 1L << 31)
    '\x80\x00\x00\x00'

The low bits are more tricky.  ~(1 << 31) assumes that ints are 32 bits.
If you really want 31 1 bits then the expression ((1L << 32) - (1L <<
31) - 1) works but ugly.  In this case (and probably most cases) we just
want to clear the 31st bit.  In that case, using ~(1L << 31) works:

    >>> hex(0xffffffffL & ~(1L<<31))
    '0x7FFFFFFFL'

Whew, my head hurts. :-)

  Neil

reply