[Distutils] Source distribution fails when packages have a setup.cfg file and are checked out from Perforce

Philippe Muller philippe.muller at gmail.com
Mon Dec 16 13:28:28 CET 2013


Hello,

My code is versionned using Perforce, and when creating a source
distribution, I get this error :
$ python setup.py sdist
[...]
copying setup.cfg -> foo-0.4.0
Writing foo-0.4.0/setup.cfg
error: foo-0.4.0/setup.cfg: Permission denied

That's happening because Perforce forces files to be read-only when not
"Perforce opened".
If I do a "p4 open setup.cfg" before creating the source distribution, the
setup.cfg file will be writable, so will its copy, and the source
distribution is created without any issue.

I currently use a more hackish workaround :
chmod +w setup.cfg ; python setup.py sdist ; chmod -w setup.cfg

But that's ugly. Does anyone know a cleaner way to bypass this issue ?

Thanks,

Philippe Muller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20131216/23ad1787/attachment.html>


More information about the Distutils-SIG mailing list