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 pitrou
Recipients pitrou
Date 2008-08-16.21:37:36
SpamBayes Score 2.860151e-11
Marked as misclassified No
Message-id <1218922658.18.0.0206081400424.issue3571@psf.upfronthosting.co.za>
In-reply-to
Content
I've been trying to track down the following failure which very recently
has started to plague the py3k buildbots:

[...]
test_os
Traceback (most recent call last):
  File "./Lib/test/regrtest.py", line 1197, in <module>
    main()
  File "./Lib/test/regrtest.py", line 400, in main
    print(test)
  File
"/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line
1490, in write
    self.flush()
  File
"/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line
1455, in flush
    self.buffer.flush()
  File
"/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line
1071, in flush
    self._flush_unlocked()
  File
"/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/io.py", line
1079, in _flush_unlocked
    n = self.raw.write(self._write_buf)
IOError: [Errno 9] Bad file descriptor


I've determined that the failure in writing to the raw stream underlying
stdout is caused by the fact that the file descriptor 0 has been closed
in test_os.test_closerange:

    def test_closerange(self):
        f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
        # close a fd that is open, and one that isn't
        os.closerange(f, f+2)

The problem arises when the call to os.open above returns 0. Normally 0
is the file descriptor underlying stdin, I don't know why it ends up
available for other uses, this would deserve investigation.

In the meantime, a way of circumventing this problem would be to rewrite
test_closerange in a saner way, such that closerange() doesn't try to
close important file descriptors.
History
Date User Action Args
2008-08-16 21:37:38pitrousetrecipients: + pitrou
2008-08-16 21:37:38pitrousetmessageid: <1218922658.18.0.0206081400424.issue3571@psf.upfronthosting.co.za>
2008-08-16 21:37:37pitroulinkissue3571 messages
2008-08-16 21:37:36pitroucreate