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

Pip 404's #66507

Closed
wilbertom mannequin opened this issue Aug 31, 2014 · 10 comments
Closed

Pip 404's #66507

wilbertom mannequin opened this issue Aug 31, 2014 · 10 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@wilbertom
Copy link
Mannequin

wilbertom mannequin commented Aug 31, 2014

BPO 22311
Nosy @malemburg, @pitrou, @scoder, @dstufft
Superseder
  • bpo-22278: urljoin duplicate slashes
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-09-01.17:50:31.903>
    created_at = <Date 2014-08-31.09:34:41.653>
    labels = ['type-bug', 'library']
    title = "Pip 404's"
    updated_at = <Date 2014-09-01.17:50:31.902>
    user = 'https://bugs.python.org/wilbertom'

    bugs.python.org fields:

    activity = <Date 2014-09-01.17:50:31.902>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-09-01.17:50:31.903>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2014-08-31.09:34:41.653>
    creator = 'wilbertom'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 22311
    keywords = []
    message_count = 10.0
    messages = ['226160', '226161', '226162', '226165', '226166', '226169', '226235', '226236', '226238', '226239']
    nosy_count = 5.0
    nosy_names = ['lemburg', 'pitrou', 'scoder', 'dstufft', 'wilbertom']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '22278'
    type = 'behavior'
    url = 'https://bugs.python.org/issue22311'
    versions = ['Python 3.5']

    @wilbertom
    Copy link
    Mannequin Author

    wilbertom mannequin commented Aug 31, 2014

    I know that issues like this one are usually on the users(my) fault, but I think pip might be broken this time for real.

    Every time I run pip install, a 404 error is raised:

    (venv) /tmp wil
    >>> pip install flask
    Requirement already satisfied (use --upgrade to upgrade): flask in /home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/Flask-0.11_dev-py3.5.egg
    Downloading/unpacking Werkzeug>=0.7 (from flask)
      HTTP error 404 while getting https://pypi.python.org/simple/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043 (from https://pypi.python.org/simple/werkzeug/)
    Cleaning up...
    Exception:
    Traceback (most recent call last):
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/basecommand.py", line 122, in main
        status = self.run(options, args)
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/commands/install.py", line 278, in run
        requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/req.py", line 1197, in prepare_files
        do_download,
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/req.py", line 1375, in unpack_url
        self.session,
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/download.py", line 547, in unpack_http_url
        resp.raise_for_status()
      File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/_vendor/requests/models.py", line 795, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    pip._vendor.requests.exceptions.HTTPError: 404 Client Error: Not Found

    /home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/basecommand.py:158: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('10.0.0.6', 52061), raddr=('23.235.44.175', 443)>
    exit = UNKNOWN_ERROR
    Storing debug log for failure in /home/wil/.pip/pip.log

    With flask-sqlalchemy as a example.

    Right:

    https://pypi.python.org/packages/source/F/Flask-SQLAlchemy/Flask-SQLAlchemy-2.0.tar.gz#md5=06ae73194cca73b72e178f870d1dac7c

    PIP(wrong):

    https://pypi.python.org/simple/packages/source/F/Flask-SQLAlchemy/Flask-SQLAlchemy-2.0.tar.gz/#md5=06ae73194cca73b72e178f870d1dac7c

    Notice the simple added after to .org and the / added after .tar.gz

    @scoder
    Copy link
    Contributor

    scoder commented Aug 31, 2014

    I noticed this, too. I think it's due to the urllib changes in bpo-22118.

    @scoder scoder added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Aug 31, 2014
    @wilbertom
    Copy link
    Mannequin Author

    wilbertom mannequin commented Aug 31, 2014

    Good to know I'm not the only one.

    In the comments above, scratch the "/" after .gz. Looks like it's just a redirect adding it. This is the actual url generated.

    https://pypi.python.org/simple/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043

    @pitrou
    Copy link
    Member

    pitrou commented Aug 31, 2014

    See issue bpo-22278.

    @wilbertom
    Copy link
    Mannequin Author

    wilbertom mannequin commented Aug 31, 2014

    Also I see PIP is it's own project. Should I migrate the issue? It won't be as easy as I thought to fix.

    >>> git diff
    diff --git a/pip/_vendor/distlib/locators.py b/pip/_vendor/distlib/locators.py
    index 07bc1fd..b7ef31a 100644
    --- a/pip/_vendor/distlib/locators.py
    +++ b/pip/_vendor/distlib/locators.py
    @@ -949,7 +949,7 @@ class AggregatingLocator(Locator):
     # versions which don't conform to PEP 426 / PEP 440.
     default_locator = AggregatingLocator(
                         JSONLocator(),
    -                    SimpleScrapingLocator('https://pypi.python.org/simple/',
    +                    SimpleScrapingLocator('https://pypi.python.org/',
                                               timeout=3.0),
                         scheme='legacy')
     
    diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py
    index 7c68738..738bbf5 100644
    --- a/pip/cmdoptions.py
    +++ b/pip/cmdoptions.py
    @@ -189,7 +189,7 @@ index_url = OptionMaker(
         '-i', '--index-url', '--pypi-url',
         dest='index_url',
         metavar='URL',
    -    default='https://pypi.python.org/simple/',
    +    default='https://pypi.python.org/',
         help='Base URL of Python Package Index (default %default).')
     
     extra_index_url = OptionMaker(

    Still gives errors. A different one.

    @malemburg
    Copy link
    Member

    On 31.08.2014 11:34, Wilberto Morales wrote:
    > 
    > New submission from Wilberto Morales:
    > 
    > I know that issues like this one are usually on the users(my) fault, but I think pip might be broken this time for real.
    > 
    > Every time I run pip install, a 404 error is raised:
    > 
    > (venv) /tmp wil
    >>>> pip install flask
    > Requirement already satisfied (use --upgrade to upgrade): flask in /home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/Flask-0.11_dev-py3.5.egg
    > Downloading/unpacking Werkzeug>=0.7 (from flask)
    >   HTTP error 404 while getting https://pypi.python.org/simple/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043 (from https://pypi.python.org/simple/werkzeug/)

    The URL is wrong. It should be:

    https://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043

    The added /simple/ in the path is causing the problem. Do you perhaps
    have a local config for pip that is adding this URL path ?

    FWIW: It "pip install werkzeug" works for me.

    @dstufft
    Copy link
    Member

    dstufft commented Sep 1, 2014

    Yea can you give more information? How are you reproducing this? What version of Python? I can't reproduce it locally.

    @scoder
    Copy link
    Contributor

    scoder commented Sep 1, 2014

    CPython 3.5, latest development versions. This started failing on August 21st, presumably with the changes for bpo-22118.

    @dstufft
    Copy link
    Member

    dstufft commented Sep 1, 2014

    Ok, I'll pull down Python 3.5 in a bit and see what is what.

    @pitrou
    Copy link
    Member

    pitrou commented Sep 1, 2014

    No need to keep this open, this is tackled in bpo-22278.

    @pitrou pitrou closed this as completed Sep 1, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants