[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

Peter Simanyi report at bugs.python.org
Tue May 26 21:57:45 CEST 2009


Peter Simanyi <psimanyi at namcobandaigames.com> added the comment:

Re: Ubuntu: I can't reproduce the problem. At this point, I consider this problem Windows XP-only.

Re: Windows & bash: I decided to verify that this problem occurs even if running outside of Bash in 
the native (and wonderful) shell CMD.EXE. It *does* occur. Here's the state:

[1] Run my script in Bash, which fails as in my previous append from today.
[2] Start CMD.EXE. Then run a "touch b.py" in Bash, then verify using Bash "ls -l" that b.py is 
protection 444 (readonly).
[3] In CMD.EXE, run "python -v a.py" (I don't know how to use something like grep in CMD.EXE, so I 
just manually copy/pasted the "python -v" lines.) The following lines in CMD.EXE's output show that 
the problem still occurs in CMD.EXE:

# C:\Documents and Settings\psimanyi\b.pyc has bad mtime
import b # from C:\Documents and Settings\psimanyi\b.py
# can't create C:\Documents and Settings\psimanyi\b.pyc
b
# clear __builtin__._


If you are unable to reproduce this on XP, I will be happy to help.

I would not be surprised if this had something to do with the granularity of mtime or some other 
oddity of Windows, because: if I delete the sleep in the Bash script, then rerun the Bash script very 
quickly using "control-P control-J" typed ahead, sometimes the Bash script fails and sometimes it 
succeeds! (Nice work, Windows.)

Thanks much.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6074>
_______________________________________


More information about the Python-bugs-list mailing list