How to get rid of "hex/oct constants > sys.maxint" warning?
Grant Edwards
grante at visi.com
Wed Aug 11 10:58:10 EDT 2004
I'm getting tired of seeing meaningless warnings from my code,
but I can't figure out how to get rid of them:
For example:
fcntl.ioctl(fd,0xc0047a80,s) causes
FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
Firstly, I have no idea what that error means in this context.
0xc0047a80 isn't intended to be an integer (either positive or
negative): it's just a chunk of 32 bits.
Googling the newsgroup came up with the suggestion that putting
an "L" on the end of the constant would eliminate the warning,
but it causes an error:
fcntl.ioctl(fd,0xc0047a80L,s) causes
OverflowError: long int too large to convert to int
So, that doesn't work.
How _do_ I get rid of the warning? Is there a way to tell
Python that the constant isn't an integer, it's just a bit
pattern?
--
Grant Edwards grante Yow! Mr and Mrs PED, can
at I borrow 26.7
visi.com
More information about the Python-list
mailing list