Message10074

Author dstromberg
Recipients dstromberg
Date 2015-05-21.23:13:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432249993.87.0.147592441751.issue2358@psf.upfronthosting.co.za>
In-reply-to
Content
This file has content (it's not just 0 length), and is readable from CPython and Pypy using open, and is readable in Jython 2.7.0 using os.open - but:

$ /usr/local/jython-2.7.0/bin/jython
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_65
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> pid = os.getpid()
>>> file_ = open('/proc/{}/status'.format(pid), 'r')
>>> file_.read()
''
>>> file_.close()
>>>

Using strace, I see Jython open the file as #15 and then:
2595  dup2(16, 15)                      = 15
2595  close(15)                         = 0

...and close it without any read being done.  I didn't notice any mmap'ing going on either.  I'm not sure what it was doing with the dup2'd filedescriptor.

Thanks for Jython!
History
Date User Action Args
2015-05-21 23:13:13dstrombergsetrecipients: + dstromberg
2015-05-21 23:13:13dstrombergsetmessageid: <1432249993.87.0.147592441751.issue2358@psf.upfronthosting.co.za>
2015-05-21 23:13:13dstromberglinkissue2358 messages
2015-05-21 23:13:13dstrombergcreate