msg104702 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-01 10:38 |
I get the following failure running test_imp on py3k, Mac OS X 10.6.3.
======================================================================
ERROR: test_package___file__ (__main__.PEP3147Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_imp.py", line 303, in test_package___file__
support.forget('pep3147')
File "/compile/python-trunk3/Lib/test/support.py", line 227, in forget
unlink(source + 'c')
File "/compile/python-trunk3/Lib/test/support.py", line 186, in unlink
os.unlink(filename)
OSError: [Errno 20] Not a directory: '/dev/null/lib/python32.zip/pep3147.pyc'
|
msg104705 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-01 10:49 |
I see similar failures (failing to unlink weird paths from support.py) in: test_imp.py, test_import.py, test_pydoc.py, test_runpy.py,
|
msg104706 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-01 10:54 |
So I'm assuming issue 8587 (same failure in test_import.py) is a duplicate of this. I'll close 8587.
|
msg104830 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-03 10:30 |
I'm seeing a "similar" (but not identical) failure on py3k / Windows 7 in test_marshal. Failure in the same code path in support.py:
======================================================================
ERROR: test_floats (__main__.FloatTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "../Lib/test/test_marshal.py", line 14, in helper
f = open(support.TESTFN, "wb")
IOError: [Errno 13] Permission denied: '@test_5324_tmp'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../Lib/test/test_marshal.py", line 88, in test_floats
self.helper(f)
File "../Lib/test/test_marshal.py", line 26, in helper
support.unlink(support.TESTFN)
File "C:\compile\py3k\lib\test\support.py", line 186, in unlink
os.unlink(filename)
WindowsError: [Error 5] Access is denied: '@test_5324_tmp'
----------------------------------------------------------------------
|
msg104831 - (view) |
Author: Tim Golden (tim.golden) * |
Date: 2010-05-03 10:45 |
This is basically issue 7743 which is a combination of:
* Using the same filename for all tests in one process
* Something (TSvn / Virus Checker) having a delete-share handle
* Not renaming the file before removing it in test.support.unlink
MvL suggested a change to the underlying unlink. I'm unconvinced
that this would solve the issue, but I haven't put together the
test cases needed to show this. For this current issue, I believe
that patching test.support.unlink to rename (to a guid-based
name in the same directory, say) before deleting would solve
all this.
It's fairly reproducible; there's a mini-test harness on
that other call which will throw up these errors often
enough to be useful.
|
msg104840 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2010-05-03 14:35 |
Surely not bug 7743 "Additional potential string -> float conversion issues."
|
msg104853 - (view) |
Author: Tim Golden (tim.golden) * |
Date: 2010-05-03 16:40 |
Sorry, typing too fast:
http://bugs.python.org/issue7443 - test.support.unlink issue on Windows platform
at least insofar as the issue applies to Windows. I imagine that the
OS X thingis completely different.
|
msg104881 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2010-05-03 20:50 |
I cannot reproduce this on my 10.6.3 machine either running the full test suite, or running:
./python.exe Lib/test/test_imp.py
./python.exe -m unittest test.test_imp
|
msg104882 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-03 20:54 |
Hmm... happens reliably for me.
|
msg104885 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2010-05-03 21:14 |
How odd. I'm on r80727 in py3k.
|
msg104887 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-03 21:35 |
Yep, same here.
|
msg104961 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-04 17:59 |
Any idea where this path comes from? I can go spelunking through the code myself to investigate.
|
msg104962 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-04 18:10 |
Ok, so the cause of the bug is 'simple' - not sure what the best fix is.
When I run python from a freshly built py3k I have the following as sys.path:
['', '/dev/null/lib/python32.zip', '/compile/python-trunk3/Lib', '/compile/python-trunk3/Lib/plat-darwin', '/compile/python-trunk3/build/lib.macosx-10.4-x86_64-3.2-pydebug', '/Volumes/Second Drive/michael/.local/lib/python/3.2/site-packages']
Note that weird second entry!
support.forget(...) trys to unlink the supplied name (+.py + c|o) from every path in sys.path.
The unlink function catches OSError, but *only* if the errno is errno.ENOENT. On my system the specific error raises is:
OSError: [Errno 20] Not a directory
|
msg104963 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2010-05-04 18:12 |
Maybe you just want to relax the test in the except clause of test.support.unlink()? Or change the test to
if error.errno not in (errno.ENOENT, errno.ENOTDIR)
?
|
msg104964 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-04 18:14 |
On trunk the definition of unlink is:
def unlink(filename):
try:
os.unlink(filename)
except OSError:
pass
:-)
Changing it as you suggest fixes the problem though. Ok to commit?
|
msg104967 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2010-05-04 18:22 |
+1
|
msg104981 - (view) |
Author: Michael Foord (michael.foord) * |
Date: 2010-05-04 22:37 |
Committed revision 80771.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:00 | admin | set | github: 52832 |
2010-05-04 22:37:45 | michael.foord | set | status: open -> closed messages:
+ msg104981
assignee: michael.foord -> barry resolution: accepted -> works for me stage: needs patch -> resolved |
2010-05-04 18:22:07 | barry | set | assignee: barry -> michael.foord resolution: works for me -> accepted messages:
+ msg104967 |
2010-05-04 18:14:49 | michael.foord | set | messages:
+ msg104964 |
2010-05-04 18:12:13 | barry | set | messages:
+ msg104963 |
2010-05-04 18:10:43 | michael.foord | set | messages:
+ msg104962 |
2010-05-04 17:59:30 | michael.foord | set | messages:
+ msg104961 |
2010-05-03 21:35:12 | michael.foord | set | messages:
+ msg104887 |
2010-05-03 21:14:52 | barry | set | messages:
+ msg104885 |
2010-05-03 20:54:27 | michael.foord | set | messages:
+ msg104882 |
2010-05-03 20:50:59 | barry | set | resolution: works for me messages:
+ msg104881 |
2010-05-03 16:40:19 | tim.golden | set | messages:
+ msg104853 |
2010-05-03 14:35:18 | barry | set | messages:
+ msg104840 |
2010-05-03 10:45:21 | tim.golden | set | nosy:
+ tim.golden title: test.support errors (py3k) -> test_imp.py test failures on Py3K Mac OS X messages:
+ msg104831
|
2010-05-03 10:33:54 | michael.foord | set | title: test_imp.py test failures on Py3K Mac OS X -> test.support errors (py3k) |
2010-05-03 10:30:04 | michael.foord | set | messages:
+ msg104830 |
2010-05-01 14:10:42 | r.david.murray | set | assignee: barry |
2010-05-01 13:56:28 | r.david.murray | set | assignee: barry -> (no value)
nosy:
+ ezio.melotti, flox |
2010-05-01 11:07:56 | pitrou | set | assignee: barry
nosy:
+ barry components:
+ Tests stage: test needed -> needs patch |
2010-05-01 10:54:16 | michael.foord | set | messages:
+ msg104706 |
2010-05-01 10:49:46 | michael.foord | set | messages:
+ msg104705 |
2010-05-01 10:38:13 | michael.foord | create | |