Giter Site home page Giter Site logo

Comments (14)

vbabiy avatar vbabiy commented on May 18, 2024

Couldn't reproduce this in my own tests with

pip install

https://github.com/mitsuhiko/werkzeug/tarball/master#egg=Werkzeug-0.7dev

Not sure whether if Github fixed something or there is a difference between
using nodeload in the URL.


Original Comment By: Jannis Leidel

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

github obviously changed behaviour (I also reported a bug there about the
missing content-type header).

but still pip needs fixing, because it'll still crash if it doesn't get a c-t
header.


Original Comment By: Thomas Waldmann

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

Thomas, it seems you are running an older version of pip (0.7.2). Is it
possible for you to upgrade to pip 8.2? I am curious if you would still get
this error running pip 8.2


Original Comment By: Kelsey Hightower

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

I can't reproduce this anymore but there was an issue with Github due not
sending a content type header. Following command failed for me with the same
error as above.

pip install https://github.com/divio/django-cms/tarball/master

I also think that pip should handle missing content type headers more
graceful. I use and used pip 0.8.2.


Original Comment By: Anonymous

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

Thanks for the reply, I will work up a patch and get it ready for review.


Original Comment By: Kelsey Hightower

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

Fixed in my fork:

https://bitbucket.org/khightower/pip/changeset/1bb3bf439fdb

The Solution

If the HTTP response header does not define the content-type, set it to an
empty string which supports the 'lower' attribute required by
mimetypes.guess_extension()


Original Comment By: Kelsey Hightower

from pip.

vbabiy avatar vbabiy commented on May 18, 2024

Created a new fork without named branches.

https://bitbucket.org/khightower/pip-issue-207/changeset/d486e99d8da4


Original Comment By: Kelsey Hightower

from pip.

hltbra avatar hltbra commented on May 18, 2024

Attaching gist for Kelsey's patch: https://gist.github.com/886024

(repository pip-issue-207 was removed)

from pip.

igorsobreira avatar igorsobreira commented on May 18, 2024

I'm having the same issue here:

$ pip install https://github.com/pypa/pip/archive/develop.zip
Downloading/unpacking https://github.com/pypa/pip/archive/develop.zip
Exception:
Traceback (most recent call last):
  File "/Users/igor/.envs/removeme/lib/python2.7/site-packages/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/Users/igor/.envs/removeme/lib/python2.7/site-packages/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/igor/.envs/removeme/lib/python2.7/site-packages/pip/req.py", line 1033, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/Users/igor/.envs/removeme/lib/python2.7/site-packages/pip/req.py", line 1161, in unpack_url
    retval = unpack_http_url(link, location, self.download_cache, self.download_dir)
  File "/Users/igor/.envs/removeme/lib/python2.7/site-packages/pip/download.py", line 535, in unpack_http_url
    content_type = resp.info()['content-type']
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/rfc822.py", line 388, in __getitem__
    return self.dict[name.lower()]
KeyError: 'content-type'

$ pip --version
pip 1.3.1 from /Users/igor/.envs/removeme/lib/python2.7/site-packages (python 2.7)

from pip.

eternicode avatar eternicode commented on May 18, 2024

I was having this same issue earlier today with installing https://github.com/django/django-localflavor-us/archive/e81479b3a4.zip , but github is now sending the correct header to "fix" it.

Strange that it seems to be so intermittent...

from pip.

igorsobreira avatar igorsobreira commented on May 18, 2024

I've sent an email to github support, they said it was really a bug. Already fixed!

from pip.

pnasrat avatar pnasrat commented on May 18, 2024

We should certainly fail a bit more gracefully.

from pip.

hltbra avatar hltbra commented on May 18, 2024

Closing this issue because of pull request #872 with the fix.

from pip.

davvid avatar davvid commented on May 18, 2024

I ran into this issue today on the "develop" branch. PR forthcoming.

from pip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.