msg261919 - (view) |
Author: Peter Inglesby (inglesp) * |
Date: 2016-03-17 17:16 |
I get the following test failure against changeset 100576 on OSX 10.9.5: $ ./python.exe -m test test_import [1/1] test_import test test_import failed -- Traceback (most recent call last): File "/Users/peteringlesby/src/cpython/Lib/test/test_import/__init__.py", line 301, in test_timestamp_overflow os.stat(compiled) FileNotFoundError: [Errno 2] No such file or directory: '__pycache__/@test_68937_tmp.cpython-36.pyc' 1 test failed: test_import |
|
|
msg261922 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2016-03-17 17:41 |
Sorry, I am unable to reproduce this on either 10.9.5 or current 10.11.3 OS X systems. Is there something unusual about the working directory you are running the tests from, like residing on an NFS or other networked file system? Any special ./configure options? Does the test always fail? |
|
|
msg261927 - (view) |
Author: Peter Inglesby (inglesp) * |
Date: 2016-03-17 18:37 |
I can reproduce it reliably. I ran ./configure with --with-pydebug. I'm not using NFS, and I'm not aware of anything else unusual about my filesystem. The fact that a timestamp overflows in the failing test is a red herring -- the following also fails, with os.stat raising FileNotFoundError: def test_without_timestamp_overflow(self): sys.path.insert(0, os.curdir) try: source = TESTFN + ".py" compiled = importlib.util.cache_from_source(source) with open(source, 'w') as f: pass __import__(TESTFN) os.stat(compiled) finally: del sys.path[0] remove_files(TESTFN) I've verified that TESTFN does get imported by writing 'print("hello")' to the source file. |
|
|
msg261929 - (view) |
Author: Peter Inglesby (inglesp) * |
Date: 2016-03-17 18:50 |
The problem is that I have PYTHONDONTWRITEBYTECODE set in my environment. Should the setUp and tearDown methods ensure that PYTHONDONTWRITEBYTECODE is cleared and reset? |
|
|
msg261930 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2016-03-17 19:23 |
Ah, setting PYTHONDONTWRITEBYTECODE explains it. When running the tests via "make test", python is invoked with -E to avoid issues like that. But here's a patch that skips test_timestamp_overflow if bytecode files cannot be written (Issue20796 documents a similar problem and workaround for test_import). |
|
|
msg261931 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-03-17 19:50 |
LGTM, Ned. |
|
|
msg261937 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-03-17 21:57 |
New changeset 915f158633f4 by Ned Deily in branch '3.5': Issue #26583: Skip test_timestamp_overflow in test_import if bytecode https://hg.python.org/cpython/rev/915f158633f4 New changeset e8cab14d8a47 by Ned Deily in branch 'default': Issue #26583: merge from 3.5 https://hg.python.org/cpython/rev/e8cab14d8a47 |
|
|
msg261938 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2016-03-17 21:59 |
Pushed for release in 3.5.2 and 3.6.0. |
|
|