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
lib2to3 and packaging tests fail because they write into protected directory #56540
Comments
Some of the tests for lib2to3 write into folders which are protected in an installed Python. This means that regression tests fail when run on an installed Python, even though they run wihtout these errors on a source build. I think writes should be done into temp files, so that you can run regressions on installed Pythons. Example failure: ====================================================================== Traceback (most recent call last):
File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 190, in check_file_refactoring
rt.refactor_file(test_file, True)
File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 353, in refactor_file
write=write, encoding=encoding)
File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 518, in processed_file
self.write_file(new_text, filename, old_text, encoding)
File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 530, in write_file
f = _open_with_encoding(filename, "w", encoding=encoding)
IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/lib2to3/tests/data/fixers/parrot_example.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 200, in test_refactor_file
self.check_file_refactoring(test_file, _DEFAULT_FIXERS)
File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 194, in check_file_refactoring
with open(test_file, "wb") as fp:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/lib2to3/tests/data/fixers/parrot_example.py' |
Some packaging tests also fail, for similar reasons: ====================================================================== Traceback (most recent call last):
File "/usr/local/lib/python3.3/packaging/tests/test_database.py", line 114, in setUp
with open(record_file, 'w') as file:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/packaging/tests/fake_dists/babar-0.1.dist-info/RECORD' |
This should not be too hard to fix: I’ll move the directory with the mock projects to a temp dir, add that to sys.path, and then we’ll be able to read and write. |
problem exists in python 2.7.2 (should this be reported as a separate issue?) [Python-2.7.2]$ python -m test.regrtest -v test_lib2to3 e.g., File "/usr/local/lib/python2.7/lib2to3/tests/test_refactor.py", line 194, in check_file_refactoring |
New changeset 2b5a0c4e052b by Éric Araujo in branch '3.2': New changeset 7ee8f413188e by Éric Araujo in branch 'default': |
New changeset a425408f1e52 by Éric Araujo in branch '2.7': |
This is now fixed. Let me just eat these words: “This should not be too hard to fix”. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: