New submission from Tim Golden <m...@timgolden.me.uk>:

If test_heapq is run before test_import on the current py3k head,
test_import will fail as per the attached traceback.

python -m test.regrtest -W test_heapq test_import > test_import.log

At a glance I can't see any obvious reason why test_heapq should have
any effect on test_import. Raising this bug while I try to narrow down.

An extra assert inside support.make_legacy_pyc confirms that
the .pyc being renamed into does in fact already exist.

Running test_import on its own or via regrtest when not preceded
by test_heapq runs with error.

----------
files: test_import.log
messages: 103488
nosy: tim.golden
severity: normal
status: open
title: test_heapq interfering with test_import on py3k
Added file: http://bugs.python.org/file16972/test_import.log

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8440>
_______________________________________
test_heapq
test_import
compiled to __pycache__\longlist.cpython-32.pyc
test test_import failed -- Traceback (most recent call last):
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\test\test_import.py",
 line 167, in test_module_with_large_stack
    exec('import ' + module)
  File "<string>", line 1, in <module>
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\importlib\_bootstrap.py",
 line 151, in decorated
    return fxn(self, module)
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\importlib\_bootstrap.py",
 line 320, in load_module
    code_object = self.get_code(module.__name__)
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\importlib\_bootstrap.py",
 line 429, in get_code
    "object for {0!r}".format(fullname))
ImportError: no source or bytecode available to create code object for 
'longlist'

Re-running test test_import in verbose mode
test_case_sensitivity (test.test_import.ImportTests) ... ok
test_double_const (test.test_import.ImportTests) ... ok
test_execute_bit_not_copied (test.test_import.ImportTests) ... skipped 'test 
meaningful only on posix systems'
test_failing_import_sticks (test.test_import.ImportTests) ... ok
test_failing_reload (test.test_import.ImportTests) ... ok
test_file_to_source (test.test_import.ImportTests) ... ok
test_imp_module (test.test_import.ImportTests) ... ok
test_import (test.test_import.ImportTests) ... ok
test_import_by_filename (test.test_import.ImportTests) ... ok
test_import_initless_directory_warning (test.test_import.ImportTests) ... ok
test_import_name_binding (test.test_import.ImportTests) ... ok
test_module_with_large_stack (test.test_import.ImportTests) ... compiled to 
__pycache__\longlist.cpython-32.pyc
ERROR
test___cached__ (test.test_import.PycacheTests) ... ok
test___cached___legacy_pyc (test.test_import.PycacheTests) ... ok
test_import_pyc_path (test.test_import.PycacheTests) ... ok
test_missing_source (test.test_import.PycacheTests) ... ok
test_missing_source_legacy (test.test_import.PycacheTests) ... ok
test_package___cached__ (test.test_import.PycacheTests) ... ok
test_package___cached___from_pyc (test.test_import.PycacheTests) ... ok
test_unwritable_directory (test.test_import.PycacheTests) ... skipped 'test 
meaningful only on posix systems'
test_basics (test.test_import.PycRewritingTests) ... ok
test_foreign_code (test.test_import.PycRewritingTests) ... ok
test_incorrect_code_name (test.test_import.PycRewritingTests) ... ok
test_module_without_source (test.test_import.PycRewritingTests) ... ok
test_UNC_path (test.test_import.PathsTests) ... ok
test_trailing_slash (test.test_import.PathsTests) ... ok
test_issue3221 (test.test_import.RelativeImportTests) ... ok
test_relimport_star (test.test_import.RelativeImportTests) ... ok
test_override_builtin (test.test_import.OverridingImportBuiltinTests) ... ok

======================================================================
ERROR: test_module_with_large_stack (test.test_import.ImportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\test\test_import.py",
 line 161, in test_module_with_large_stack
    make_legacy_pyc(filename)
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\test\support.py", 
line 209, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
WindowsError: [Error 183] Cannot create a file when that file already exists

----------------------------------------------------------------------
Ran 29 tests in 1.672s

FAILED (errors=1, skipped=2)
test test_import failed -- Traceback (most recent call last):
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\test\test_import.py",
 line 161, in test_module_with_large_stack
    make_legacy_pyc(filename)
  File 
"C:\work-in-progress\make-snapshots\branches\py3k\python\lib\test\support.py", 
line 209, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
WindowsError: [Error 183] Cannot create a file when that file already exists

_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to