Kevin Chen added the comment:

This is essentially the way things were done in version 2.5.4 of Python. The 
unlink() always succeeded, because the created .pyc file permission is always 
set to 0666 in the fd=open() function. This means the .pyc will never be 
created as read-only, and as long as they are never set to read-only manually 
by the user, everything will be okay.

You might say this will be a problem if someone accidentally set the it to 
read-only. Well we have been using Python 2.5 for many years, and we have 
managed quite well, so it is not really going to be a big issue, and can be 
fixed in the future. 

Whereas at the moment we have a PROBLEM!! With the current state of the Python 
2.6, 2.7 and 3.2 interpreters, many Windows users cannot even think about 
upgrade from Python 2.5 because source control tools like Perforce will set all 
.py files to read-only, and so ALL created .pyc files will become read-only 
every time you run Python. I cannot stress how much pain this causes. PLEASE 
MAKE IT 2.5 EQUIVALENT ASAP!  THANK YOU!!

even just this will do the trick:
-------------------------------------

    fd = open(filename, O_EXCL|O_CREAT|O_WRONLY|O_TRUNC
#ifdef O_BINARY
                            |O_BINARY   /* necessary for Windows */
#endif
#ifdef __VMS
            , mode, "ctxt=bin", "shr=nil"
#elif defined(MS_WINDOWS)
            , 0666
#else
            , mode
#endif
          );

-----------------------------------


And a side note, for the VC8 build for PC, the file random.c was left out from 
the visual studio project file for pythoncore project. It gives these errors 
when I try recompile:

Error   2       error LNK2019: unresolved external symbol __PyRandom_Init 
referenced in function _Py_Main       main.obj
Error   3       error LNK2001: unresolved external symbol __PyRandom_Init       
pythonrun.obj
Error   4       error LNK2019: unresolved external symbol __PyOS_URandom 
referenced in function _posix_urandom  posixmodule.obj

This is my first time using bug tracker, so please point me to the appropriate 
place to put this. Thank you.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6074>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to