Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Conversation

@juliogonzalez
Copy link

@juliogonzalez juliogonzalez commented Jun 5, 2018

This PR fixes the setup, as some python modules such as setuptools are now a redirect.

For example:

https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.zip is now a 301 redirect to https://pypi.org/packages/source/s/setuptools/setuptools-4.0.1.zip

Current ez_setup.py implementation downloads https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.zip which is now a HTML file, and then crashes:

pi@raspberrypi:~/Adafruit_Python_DHT $ python setup.py install
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.zip
Extracting in /tmp/tmp6NJujO
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    use_setuptools()
  File "/home/pi/Adafruit_Python_DHT/ez_setup.py", line 140, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/home/pi/Adafruit_Python_DHT/ez_setup.py", line 120, in _do_download
    _build_egg(egg, archive, to_dir)
  File "/home/pi/Adafruit_Python_DHT/ez_setup.py", line 62, in _build_egg
    with archive_context(archive_filename):
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/pi/Adafruit_Python_DHT/ez_setup.py", line 100, in archive_context
    with ContextualZipFile(filename) as archive:
  File "/home/pi/Adafruit_Python_DHT/ez_setup.py", line 88, in __new__
    return zipfile.ZipFile(*args, **kwargs)
  File "/usr/lib/python2.7/zipfile.py", line 770, in __init__
    self._RealGetContents()
  File "/usr/lib/python2.7/zipfile.py", line 813, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file

After this patch:

pi@raspberrypi:~/Adafruit_Python_DHT $ python setup.py install
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.zip
Extracting in /tmp/tmp7HyCt4
Now working in /tmp/tmp7HyCt4/setuptools-4.0.1
Building a Setuptools egg in /home/pi/Adafruit_Python_DHT
/home/pi/Adafruit_Python_DHT/setuptools-4.0.1-py2.7.egg
running install
[....]

This PR should fix #96, fix #91 and maybe #92

Copy link
Contributor

@mueller-ma mueller-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@juliogonzalez
Copy link
Author

@mueller-ma, you are welcome!

I guess a merge is still needed :-)

@andrejguran
Copy link

confirming that this fix work 👍

@juliogonzalez
Copy link
Author

@mueller-ma is there anything else required from my side to get this merged?

@mueller-ma
Copy link
Contributor

@juliogonzalez I'm not affiliated with Adafruit, I just gave my approval here as your commit fixed the issue I had.

@juliogonzalez
Copy link
Author

juliogonzalez commented Jul 23, 2018

@mueller-ma, ok, sorry. Since you were able to make a review and approve the PR, I assumed you could merge as well.

Let's ping @ladyada and @tdicola as I see they merged the latest PRs.

@brennen
Copy link
Contributor

brennen commented Jul 27, 2018

Thanks for this - I think we'll probably just dispense with ez_setup.py altogether, in #101 (a sanity check there would be welcome), but I'll leave this open 'til that merges just in case.

@juliogonzalez
Copy link
Author

@brennen #101 makes all the sense to me. I will check it with my raspbian + DHT22 both installing from pypi and compilig from the repository, and will leave feedback there.

Feel free to close this PR, unless you think #101 will take a lot of time to be merged (in that case it would make sense merging this fix temporary until #101 is ready).

@brennen brennen closed this Jul 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem witch installing I can not install RaspBerry 3 and Raspbian Jessie Lite

4 participants