packaging - Proper permissions for python packages -
i keep seeing python packages... python package installs files. in packaged tar, things this:
-rw-r-----  1 schwehr eng     7 sep  3 18:10 version for:
https://github.com/scrapy/scrapy/blob/master/scrapy/version
then when python setup.py install root managed environment (e.g. fink macosx) uses root permissions, file gets owned root , permissions preserved. code run user unable access file.
this project , other projects same issue (typically eggs portion of install) use python setup.py sdist upload.
how these projects supposed build tar has proper permissions files world readable? e.g.
wget https://pypi.python.org/packages/source/s/scrapy/scrapy-0.18.2.tar.gz#md5=14f105e2fdb047c666b944990e691389  tar tfvv scrapy-0.18.2.tar.gz  | head drwx------ buildbot/buildbot 0 2013-09-03 10:30 scrapy-0.18.2/ -rw------- buildbot/buildbot 385 2013-09-03 10:27 scrapy-0.18.2/manifest.in -rw------- buildbot/buildbot 140 2013-09-03 10:30 scrapy-0.18.2/setup.cfg drwx------ buildbot/buildbot   0 2013-09-03 10:30 scrapy-0.18.2/bin/ -rw------- buildbot/buildbot 114 2013-09-03 10:27 scrapy-0.18.2/bin/runtests.bat -rwx------ buildbot/buildbot 1271 2013-09-03 10:27 scrapy-0.18.2/bin/runtests.sh -rwx------ buildbot/buildbot   68 2013-09-03 10:27 scrapy-0.18.2/bin/scrapy drwx------ buildbot/buildbot    0 2013-09-03 10:30 scrapy-0.18.2/scrapy/ -rw------- buildbot/buildbot 2785 2013-09-03 10:27 scrapy-0.18.2/scrapy/telnet.py drwx------ buildbot/buildbot    0 2013-09-03 10:30 scrapy-0.18.2/scrapy/commands/ 
it happens when sdist tarball generated restrictive umask or when files created without others/nobody read/execute permissions.
a simple workaround broak umask bits , chmod files before tar'ing
umask 0022 && chmod -r a+rx . && python setup.py sdist upload 
Comments
Post a Comment