[issue7211] select module - kevent ident field 64 bit issue

Michael Broghton report at bugs.python.org
Tue Oct 27 01:52:07 CET 2009


Michael Broghton <mbroughton at advanis.ca> added the comment:

Martin, thanks for your responses. In regards to point three:

Kqueue's are not just used for file descriptors. I believe this is the
reason why the ident field is a uintptr_t and not an int.

The example I gave was for kqueue timers. Since the operating system
does not allocate 'timer descriptors' for you, I decided to use the
return value from the id function.

Here is some code that demonstrates:

import select
a = 1
b = id(a)
c = select.kevent(a)
d = select.kevent(b)
assert a == c.ident
assert b == d.ident
assert b & (1<<32) - 1 == d.ident

The second assert will fail on 64 bit systems if 'b' is too big.

Anyway, I will try to come up with a patch for this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7211>
_______________________________________


More information about the Python-bugs-list mailing list