[Distutils] setuptools' install_script overwrites symlinked files rather than replacing symlinks

Nick Coghlan ncoghlan at gmail.com
Tue Aug 6 07:08:42 CEST 2013

On 4 August 2013 21:12, Michał Górny <mgorny at gentoo.org> wrote:
> I'm willing to write a patch. Please just tell me which solution would
> you prefer.

The standard library has switched to atomic replacement for writing
.pyc files, which seems like the appropriate solution for script
writing as well (note that os.rename isn't atomic on Windows - on
3.3+, os.replace provides atomic renaming on all supported platforms)

However, a "not a regular file or symlink" sanity check similar to the
one now performed by pycompile (see http://bugs.python.org/issue17222)
may also be appropriate here.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Distutils-SIG mailing list