[New-bugs-announce] [issue17111] test_surrogates of test_fileio fails sometimes on OS X 10.4

Ned Deily report at bugs.python.org
Sun Feb 3 09:46:35 CET 2013


New submission from Ned Deily:

Seen on "X86 Tiger 2.7" buildbot (http://buildbot.python.org/all/builders/x86%20Tiger%202.7)

test_surrogates (test.test_fileio.OtherFileTests) ... test test_fileio failed -- Traceback (most recent call last):
  File "/Users/db3l/buildarea/2.7.bolen-tiger/build/Lib/test/test_fileio.py", line 455, in test_surrogates
    self.fail('Bad output: %r' % out)
AssertionError: Bad output: 'Traceback (most recent call last):\n  File "<string>", line 1, in <module>\nIOError: [Errno 22] Invalid argument: \'\\xed\\xb2\\x80.txt\'\n[20282 refs]\n'

Looking into it a bit, the test attempts to open a file with a filename containing surrogates.  On OS X 10.4 (Tiger), an attempt to open such a file on a standard HFS+ file system appears to always fail with the above error 22 (EINVAL), rather than error 2 (ENOENT) "No such file or directory" as the test expects and as more recent versions of OS X do.  So the test should probably be changed to expect either error code.  I'm attaching a patch that should do that.

However, there is another issue.  The test does not always fail on 10.4 as one would expect.  The test on the buildbot sometimes succeeds.  On my own 10.4 system, while I predictably receive an EINVAL when attempting to open the file, running test_fileio in isolation seems to always pass and it's not obvious why it does.  The first part of the test, the local open fails as expected but, without the patch, the test of an open in a subprocess passes when it should be failing.  But I was able to reproduce the Error 22 failure, as seen on the buildbot failures, with the same interpreter build by using a --randseed value from one of the buildbot failures.  So there appears to be a test interaction problem here as well (environment variables?).

/python.exe -Wd -3 -E -tt  -R ./Lib/test/regrtest.py -uall -rwW --randseed=2535964

----------
components: Tests
files: issue_XXXXX_test_fileio.patch
keywords: buildbot, needs review, patch
messages: 181246
nosy: ned.deily
priority: normal
severity: normal
stage: patch review
status: open
title: test_surrogates of test_fileio fails sometimes on OS X 10.4
versions: Python 2.7
Added file: http://bugs.python.org/file28937/issue_XXXXX_test_fileio.patch

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


More information about the New-bugs-announce mailing list