Message9792
>>> f = file('x.tmp', 'wb')
>>> fd = f.fileno()
>>> type(fd)
<type 'org.python.core.io.FileIO'>
>>> os.fstat(fd)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor
>>> int(fd)
-1
>>> f.close()
In this code:
https://hg.python.org/jython/rev/e1a246f6a178#l5.89
we get at the integer file descriptor (index) via the private member fd. In my experience (with the debugger) fd is only ever -1, but there is an extra member that holds a Windows file handle.
This is the cause of a failure in test_tempfile, but not elsewhere as I believe we have comprehensively adapted to file descriptors that are objects.
If we support integer file descriptors, don't we need a table for them to index, as in C (and CPython)? |
|
Date |
User |
Action |
Args |
2015-04-10 15:32:48 | jeff.allen | set | recipients:
+ jeff.allen |
2015-04-10 15:32:48 | jeff.allen | set | messageid: <1428679968.32.0.0458282441534.issue2320@psf.upfronthosting.co.za> |
2015-04-10 15:32:48 | jeff.allen | link | issue2320 messages |
2015-04-10 15:32:47 | jeff.allen | create | |
|