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
Writing a pyc file is not atomic under Windows #57601
Comments
bpo-13146 solved the issue of writing pyc files under POSIX. Under Windows, the problem still exists, as the following buildbot failure shows: [317/360] test_multiprocessing
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\forking.py", line 373, in main
prepare(preparation_data)
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\forking.py", line 499, in prepare
'__parents_main__', file, path_name, etc
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\regrtest.py", line 175, in <module>
import packaging.command
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\command\__init__.py", line 4, in <module>
from packaging.util import resolve_name
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\util.py", line 5, in <module>
import csv
EOFError: EOF read where not expected
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\forking.py", line 373, in main
prepare(preparation_data)
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\forking.py", line 499, in prepare
'__parents_main__', file, path_name, etc
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\regrtest.py", line 175, in <module>
import packaging.command
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\command\__init__.py", line 4, in <module>
from packaging.util import resolve_name
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\util.py", line 5, in <module>
import csv
EOFError: EOF read where not expected
[etc.] (from http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/5551/steps/test/logs/stdio) Attached patch uses MoveFileEx to perform a (hopefully atomic) rename from a temporary file when creating the pyc file. |
I say go with the deletion for importlib. If the failure is a sign of success, then just go with it and not worry about the failure. __pycache__ guarantees that we are not losing out by clobbering some other Python version's pyc file. |
New changeset b75b41237380 by Antoine Pitrou in branch 'default': |
Ok, done. Let's see if that fixes the sporadic failures on the buildbots. |
New changeset 12940d9f8031 by Antoine Pitrou in branch 'default': |
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: