This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bgamari
Recipients bgamari
Date 2010-11-07.01:16:40
SpamBayes Score 2.4029411e-08
Marked as misclassified No
Message-id <1289092604.86.0.0417079814942.issue10345@psf.upfronthosting.co.za>
In-reply-to
Content
Even the simple example included below fails in the following manner,

$ sudo python3.1 hi.py 
<class 'int'> 3
Traceback (most recent call last):
  File "hi.py", line 13, in <module>
    ioctl(a, EVIOCGID, buf, True)
TypeError: ioctl requires a file or file descriptor, an integer and optionally an integer or buffer argument

As the debugging output demonstrates, the fileno() is in fact a valid fd.


#!/usr/bin/python
from fcntl import ioctl
EVIOCGID = 1
f = open('/dev/input/mouse0', 'w')
buf = bytes([0]*128)
a = (f.fileno(),)
print(a.__class__, a)
ioctl(a, EVIOCGID, buf, True)
print(buf)
History
Date User Action Args
2010-11-07 01:16:45bgamarisetrecipients: + bgamari
2010-11-07 01:16:44bgamarisetmessageid: <1289092604.86.0.0417079814942.issue10345@psf.upfronthosting.co.za>
2010-11-07 01:16:41bgamarilinkissue10345 messages
2010-11-07 01:16:40bgamaricreate