Skip to content

urllib2 mangles file://-scheme URLs #52902

Closed

Description

@dabrahams
mannequin
BPO 8656
Nosy @orsenthil, @dabrahams

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 = 'https://github.com/orsenthil'
closed_at = <Date 2010-05-08.03:32:26.665>
created_at = <Date 2010-05-08.01:45:27.111>
labels = ['type-bug']
title = 'urllib2 mangles file://-scheme URLs'
updated_at = <Date 2010-05-08.05:15:52.695>
user = 'https://github.com/dabrahams'

bugs.python.org fields:

activity = <Date 2010-05-08.05:15:52.695>
actor = 'orsenthil'
assignee = 'orsenthil'
closed = True
closed_date = <Date 2010-05-08.03:32:26.665>
closer = 'orsenthil'
components = []
creation = <Date 2010-05-08.01:45:27.111>
creator = 'dabrahams'
dependencies = []
files = []
hgrepos = []
issue_num = 8656
keywords = []
message_count = 5.0
messages = ['105250', '105255', '105258', '105259', '105263']
nosy_count = 3.0
nosy_names = ['exarkun', 'orsenthil', 'dabrahams']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue8656'
versions = ['Python 2.6']

Activity

  1. dabrahams commented on May 8, 2010

    dabrahamsmannequin
    MannequinAuthor
    $ touch /tmp/x.html
    $ python -c 'import urllib2;resp=urllib2.urlopen("file:///tmp/x.html");print resp.geturl()'
    file:/tmp/x.html

    note the missing // after the colon

  2. orsenthil commented on May 8, 2010

    @orsenthil
    Member

    Fixed in r80953, r80954 , r80955 and r80956.

  3. self-assigned this
    on May 8, 2010
  4. exarkun commented on May 8, 2010

    exarkunmannequin
    Mannequin

    Major buildbot failures caused by this change, eg:

    ERROR: test_file (test.test_urllib2net.OtherNetworkTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 126, in test_file
        self._test_urls(urls, self._extra_handlers(), retry=True)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 175, in _test_urls
        f = urlopen(url, req, TIMEOUT)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 28, in wrapped
        return _retry_thrice(func, exc, *args, **kwargs)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _retry_thrice
        return func(*args, **kwargs)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/urllib2.py", line 391, in open
        response = self._open(req, data)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/urllib2.py", line 409, in _open
        '_open', req)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/urllib2.py", line 369, in _call_chain
        result = func(*args)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/urllib2.py", line 1257, in file_open
        return self.open_local_file(req)
      File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/urllib2.py", line 1291, in open_local_file
        headers, 'file://'+ host + file)
    TypeError: cannot concatenate 'str' and 'NoneType' objects
  5. orsenthil commented on May 8, 2010

    @orsenthil
    Member

    On Sat, May 8, 2010 at 10:04 AM, Jean-Paul Calderone
    <report@bugs.python.org> wrote:

    TypeError: cannot concatenate 'str' and 'NoneType' objects

    Okay, I see where the problem is. I shall quickly fix it.

  6. orsenthil commented on May 8, 2010

    @orsenthil
    Member

    Fixed the change which resulted in Buildbots failure. Those should
    turn green now.

  7. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions