Skip to content

'sdist' produces tar.gz containing local path on windows #2178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kaiser1989 opened this issue Jun 4, 2020 · 4 comments
Closed

'sdist' produces tar.gz containing local path on windows #2178

Kaiser1989 opened this issue Jun 4, 2020 · 4 comments

Comments

@Kaiser1989
Copy link

Kaiser1989 commented Jun 4, 2020

Building a project with setuptools and a setup.py with:

python setup.py sdist --dist-dir C://local/path/to/my/dist/folder

creates a tar.gz. When unpacking this tar.gz on Windows, it contains the complete local path to this distribution folder. This can't be correct.

The same problem is also reported in #1185, but was closed, as it couldn't be reproduced.

Do NOT test the tar.gz with "python -m tarfile", as this unpacks the tar.gz at once, and therefore showing the correct content. To reproduce, unpack the tar.gz file with 7zip. The "tar" archive contains the correct content. But the "gz" archive provides the full local path.

If you use a relative path, just this relative path is set into the "gz" archive:
python sdist --dist-dir ./dist/folder

Long term short: Whatever is put as dist-dir, the complete path is saved in the tar.gz file.

Expected:

  • We should not provide local data in distributions
  • There shouldn't be any pathes, the 'gz' should only contain the 'tar' file

Environment Details

  • Windows 10 64bit
  • Python 3.8.2
  • Setuptools 46.4.0
@jaraco
Copy link
Member

jaraco commented Jun 15, 2020

Do I understand correctly that there is no undesirable user-facing behavior, that the only problem is the leaking of local paths in the gzip file? I do agree it would be nice not to leak that information.

@jaraco
Copy link
Member

jaraco commented Jun 15, 2020

I don't see anything in setuptools that enacts the undesirable behavior. Probably the .tar.gz is created in distutils, so it may not be worth trying to tackle this until distutils is incorporated.

@jaraco
Copy link
Member

jaraco commented Jun 27, 2020

This is a duplicate of #1185.

@jaraco
Copy link
Member

jaraco commented Mar 12, 2021

Closing in favor of the earlier issue.

@jaraco jaraco closed this as completed Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants