question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect permissions on *.egg-info directory

See original GitHub issue

It seems that the setup.py install command doesn’t set the permissions of the <package>.egg-info/* files when they already exist, relying on what is already set. As noted in https://github.com/sshuttle/sshuttle/issues/217#issuecomment-381378684, it seems many other projects suffered from the same “bug” in the last years, relying on the packager to set the permissions manually to 644 before uploading to PyPI.

Relying on the umask of the user during the package tarball creation is too error-prone, so maybe permissions should always be set automatically by setuptools.

Maybe this issue is a duplicate of https://github.com/pypa/setuptools/issues/1283, I’m not sure.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cpixlcommented, Apr 20, 2018

Yes, using pip install . still gives me the wrong permissions for the <package>.egg-info/* files.

ls -lh /usr/lib/python3.6/site-packages/sshuttle-0.78.4-py3.6.egg-info/ :

total 24K
-rw------- 1 root root    1 Apr 19 01:20 dependency_links.txt
-rw------- 1 root root   52 Apr 19 01:20 entry_points.txt
-rw-r--r-- 1 root root 1.8K Apr 19 01:20 installed-files.txt
-rw------- 1 root root 3.1K Apr 19 01:20 PKG-INFO
-rw------- 1 root root 1.5K Apr 19 01:20 SOURCES.txt
-rw------- 1 root root    9 Apr 19 01:20 top_level.txt
0reactions
lilydjwgcommented, Oct 29, 2020

Telethon had similar issues too. It made many (if not all) Python programs fail due to unreadable files when installed by root (e.g. system package managers). It also has several generated world-writable files.

What’s more, when one extracts the sdist tarball as root, the files are owned by whatever uid and gid the tarball has recorded.

Is it possible to give all files in the created tarballs 755 / 644 permissions and owned by root:root?

Read more comments on GitHub >

github_iconTop Results From Across the Web

setup.py install running egg_info error: [Errno 13] Permission ...
Afterwards, I run as a regular user and got permission issues. The fix is ownership change. After the above action, the problem was...
Read more >
Creating egg-info failing in Docker Container - Packaging
If I use that Dockerfile to build an image for one of my own Python projects, everything works out fine, even if I...
Read more >
[US3327]Meet error "could not create 'YourAppName.egg-info'
This bug has been verified and fixed on devenv_2772, the permission denied error is not shown as below: Running greenlet-0.4.0/setup.py -q ...
Read more >
problem with multiple egg.info directories - Google Groups
Nose has some test data with an 'egg.info' directory. This causes the editable install to fail. Can line 1458 of pip be changed...
Read more >
The Internal Structure of Python Eggs - Setuptools
.egg format: a directory or zipfile containing the project's code and resources, along with an EGG-INFO subdirectory that contains the project's metadata.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found