Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runpy failure #56331

Closed
pitrou opened this issue May 19, 2011 · 5 comments
Closed

test_runpy failure #56331

pitrou opened this issue May 19, 2011 · 5 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented May 19, 2011

BPO 12122
Nosy @warsaw, @ncoghlan, @pitrou, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/ncoghlan'
closed_at = <Date 2011-05-20.00:12:32.629>
created_at = <Date 2011-05-19.16:25:01.626>
labels = ['type-bug', 'tests']
title = 'test_runpy failure'
updated_at = <Date 2011-05-20.00:12:32.627>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2011-05-20.00:12:32.627>
actor = 'vstinner'
assignee = 'ncoghlan'
closed = True
closed_date = <Date 2011-05-20.00:12:32.629>
closer = 'vstinner'
components = ['Tests']
creation = <Date 2011-05-19.16:25:01.626>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 12122
keywords = []
message_count = 5.0
messages = ['136304', '136316', '136317', '136318', '136346']
nosy_count = 4.0
nosy_names = ['barry', 'ncoghlan', 'pitrou', 'vstinner']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue12122'
versions = ['Python 3.3']

@pitrou
Copy link
Member Author

pitrou commented May 19, 2011

I get the following failures in a fresh checkout:

======================================================================
ERROR: test_explicit_relative_import (test.test_runpy.RunModuleTest)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 283, in test_explicit_relative_import
    self._check_relative_imports(depth)
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 257, in _check_relative_imports
    make_legacy_pyc(mod_fname)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_main_relative_import (test.test_runpy.RunModuleTest)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 288, in test_main_relative_import
    self._check_relative_imports(depth, "__main__")
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 257, in _check_relative_imports
    make_legacy_pyc(mod_fname)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_run_module (test.test_runpy.RunModuleTest)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 273, in test_run_module
    self._check_module(depth)
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 177, in _check_module
    make_legacy_pyc(mod_fname)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_run_package (test.test_runpy.RunModuleTest)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 278, in test_run_package
    self._check_package(depth)
  File "/home/antoine/t/cpython/Lib/test/test_runpy.py", line 201, in _check_package
    make_legacy_pyc(mod_fname)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

Here is the test output:

test_run_code (test.test_runpy.RunModuleCodeTest) ... ok
test_run_module_code (test.test_runpy.RunModuleCodeTest) ... ok
test_explicit_relative_import (test.test_runpy.RunModuleTest) ... Testing relative imports at depth: 2
Package tree in: /tmp/tmpmruwyg
Updated sys.path: /tmp/tmpmruwyg
Next level in: /tmp/tmpmruwyg/runpy_pkg
Created: /tmp/tmpmruwyg/runpy_pkg/init.py
Next level in: /tmp/tmpmruwyg/runpy_pkg/runpy_pkg
Created: /tmp/tmpmruwyg/runpy_pkg/runpy_pkg/init.py
Created: /tmp/tmpmruwyg/runpy_pkg/runpy_pkg/runpy_test.py
Added sibling module: /tmp/tmpmruwyg/runpy_pkg/runpy_pkg/sibling.py
Added uncle package: /tmp/tmpmruwyg/runpy_pkg/uncle
Added cousin package: /tmp/tmpmruwyg/runpy_pkg/uncle/cousin
Added nephew module: /tmp/tmpmruwyg/runpy_pkg/uncle/cousin/nephew.py
Running from source: __runpy_pkg__.__runpy_pkg__.runpy_test
Removed sys.modules entries
Removed sys.path entry
Removed package tree
ERROR
test_invalid_names (test.test_runpy.RunModuleTest) ... ok
test_library_module (test.test_runpy.RunModuleTest) ... ok
test_main_relative_import (test.test_runpy.RunModuleTest) ... Testing main relative imports at depth: 2
Package tree in: /tmp/tmp39sx5n
Updated sys.path: /tmp/tmp39sx5n
Next level in: /tmp/tmp39sx5n/runpy_pkg
Created: /tmp/tmp39sx5n/runpy_pkg/init.py
Next level in: /tmp/tmp39sx5n/runpy_pkg/runpy_pkg
Created: /tmp/tmp39sx5n/runpy_pkg/runpy_pkg/init.py
Created: /tmp/tmp39sx5n/runpy_pkg/runpy_pkg/runpy_test.py
Added sibling module: /tmp/tmp39sx5n/runpy_pkg/runpy_pkg/sibling.py
Added uncle package: /tmp/tmp39sx5n/runpy_pkg/uncle
Added cousin package: /tmp/tmp39sx5n/runpy_pkg/uncle/cousin
Added nephew module: /tmp/tmp39sx5n/runpy_pkg/uncle/cousin/nephew.py
Running from source: __runpy_pkg__.__runpy_pkg__.runpy_test
Removed sys.modules entries
Removed sys.path entry
Removed package tree
ERROR
test_run_module (test.test_runpy.RunModuleTest) ... Testing package depth: 0
Package tree in: /tmp/tmpy4y7in
Updated sys.path: /tmp/tmpy4y7in
Created: /tmp/tmpy4y7in/runpy_test.py
Running from source: runpy_test
Removed sys.modules entries
Removed sys.path entry
Removed package tree
ERROR
test_run_package (test.test_runpy.RunModuleTest) ... Testing package depth: 1
Package tree in: /tmp/tmp_7dx_4
Updated sys.path: /tmp/tmp_7dx_4
Next level in: /tmp/tmp_7dx_4/runpy_pkg
Created: /tmp/tmp_7dx_4/runpy_pkg/init.py
Created: /tmp/tmp_7dx_4/runpy_pkg/main.py
Running from source: __runpy_pkg__
Removed sys.modules entries
Removed sys.path entry
Removed package tree
ERROR
test_basic_script (test.test_runpy.RunPathTest) ... ok
test_directory (test.test_runpy.RunPathTest) ... ok
test_directory_compiled (test.test_runpy.RunPathTest) ... ok
test_directory_error (test.test_runpy.RunPathTest) ... ok
test_main_recursion_error (test.test_runpy.RunPathTest) ... ok
test_script_compiled (test.test_runpy.RunPathTest) ... ok
test_zipfile (test.test_runpy.RunPathTest) ... ok
test_zipfile_compiled (test.test_runpy.RunPathTest) ... ok
test_zipfile_error (test.test_runpy.RunPathTest) ... ok

@pitrou pitrou added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels May 19, 2011
@ncoghlan
Copy link
Contributor

It still works fine for me (as do test_imp, test_import and test_importlib).

Did you provide any arguments to ./configure, or provide any interesting options to regrtest to get it to fail?

@ncoghlan
Copy link
Contributor

Oh, that's the other question - is there any chance you are passing -B or have PYTHONDONTWRITEBYTECODE set? (I'm not sure that would affect make_legacy_pyc, but all the errors you posted relate to unexpectedly absent pyc files and directories)

@pitrou
Copy link
Member Author

pitrou commented May 19, 2011

Indeed, PYTHONDONTWRITEBYTECODE seems set by default on this Linux install... Ouch.

@vstinner
Copy link
Member

Duplicate of bpo-12117.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants