This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kevin.chen
Recipients Steve.Thompson, amaury.forgeotdarc, barry, brian.curtin, desolat, eric.araujo, kevin.chen, markon, mucisland, pdsimanyi, pitrou
Date 2012-08-19.13:29:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345382988.3.0.246677812276.issue6074@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-08-19 13:29:48kevin.chensetrecipients: + kevin.chen, barry, amaury.forgeotdarc, pitrou, eric.araujo, brian.curtin, pdsimanyi, markon, mucisland, Steve.Thompson, desolat
2012-08-19 13:29:48kevin.chensetmessageid: <1345382988.3.0.246677812276.issue6074@psf.upfronthosting.co.za>
2012-08-19 13:29:36kevin.chenlinkissue6074 messages
2012-08-19 13:29:35kevin.chencreate