Skip to content
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

Meaningful message if corrupted setuptools #563

Closed
idgserpro opened this issue Apr 26, 2016 · 4 comments
Closed

Meaningful message if corrupted setuptools #563

idgserpro opened this issue Apr 26, 2016 · 4 comments

Comments

@idgserpro
Copy link

The primary mode of installation of setuptools is to use ez_setup.py: but if a beginner downloads a corrupted zip for some reason (check #557 for example) and don't delete the corrupted setuptools zip before running ez_setup.py again, the installation can't continue.

Since this is confusing to beginners the idea is to have a similar behavior like bootstrap-buildout.py: always download setuptools, but if you need for some reason to use a local file, use a parameter to have it (--setuptools-to-dir comes to mind).

ez_setup.py has now a specific branch and a test suite and this improvement should be done there.

@idgserpro idgserpro changed the title Implement "bootstrap-buildout.py" behavior to always download setuptools and only use a local file if set by a parameter Implement "bootstrap-buildout.py" behavior to always download setuptools and only use a local file if set by a parameter, in ez_setup.py Apr 26, 2016
@idgserpro
Copy link
Author

idgserpro commented Oct 27, 2016

@jaraco We think adding this option will add more confusion since ez_setup already has a "to_dir" parameter, which sets where setuptools should be downloaded as well.

In fact, if we change the behavior of download_setuptools in ez_setup, removing if not os.path.exists(saveto), it will break bootstrap-buildout.py since --setuptools-to-dir starts/set "to_dir" parameter, exactly for reusing an already downloaded setuptools.

We're not confident into changing this code. It has the potential of breaking other's people infrastructure.

SInce the motivation of this issue was

Shouldn't we have the same behavior in ez_setup.py? Always download but give the option to use a local copy, if needed? We're asking this because this "bad download" error is really confusing for beginners, since this is the official primary method of installation.

We started to think if we shouldn't just catch the zipfile.BadZipfile: File is not a zip file exception and add a message "Maybe you have a corrupt setuptools file. Remove it and run ez_setup again."

@jaraco
Copy link
Member

jaraco commented Nov 7, 2016

Sounds like a simple and elegant improvement to me.

@idgserpro
Copy link
Author

@jaraco Here we go: #842

@idgserpro idgserpro changed the title Implement "bootstrap-buildout.py" behavior to always download setuptools and only use a local file if set by a parameter, in ez_setup.py Meaningful message if corrupted setuptools Nov 8, 2016
@idgserpro
Copy link
Author

Fixed #842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants