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

test_urllib fails on windows #50111

Closed
ocean-city mannequin opened this issue Apr 28, 2009 · 5 comments
Closed

test_urllib fails on windows #50111

ocean-city mannequin opened this issue Apr 28, 2009 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@ocean-city
Copy link
Mannequin

ocean-city mannequin commented Apr 28, 2009

BPO 5861
Nosy @orsenthil
Dependencies
  • bpo-918368: urllib doesn't correct server returned urls
  • bpo-1378455: a problem of urllib using open_local_file
  • 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 2009-05-05.18:47:34.739>
    created_at = <Date 2009-04-28.01:43:22.132>
    labels = ['library']
    title = 'test_urllib fails on windows'
    updated_at = <Date 2009-05-05.18:47:34.738>
    user = 'https://bugs.python.org/ocean-city'

    bugs.python.org fields:

    activity = <Date 2009-05-05.18:47:34.738>
    actor = 'orsenthil'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2009-05-05.18:47:34.739>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2009-04-28.01:43:22.132>
    creator = 'ocean-city'
    dependencies = ['918368', '1378455']
    files = []
    hgrepos = []
    issue_num = 5861
    keywords = []
    message_count = 5.0
    messages = ['86713', '86714', '86770', '86880', '87262']
    nosy_count = 3.0
    nosy_names = ['orsenthil', 'ocean-city', 'rpetrov']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue5861'
    versions = ['Python 2.7']

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Apr 28, 2009

    Hello. I noticed test_urllib fails on windows.

    ======================================================================
    ERROR: test_copy (main.urlretrieve_FileTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "test_urllib.py", line 241, in test_copy
        test_support.TESTFN), second_temp)
      File "e:\python-dev\trunk\lib\urllib.py", line 94, in urlretrieve
        return _urlopener.retrieve(url, filename, reporthook, data)
      File "e:\python-dev\trunk\lib\urllib.py", line 238, in retrieve
        fp = self.open(url, data)
      File "e:\python-dev\trunk\lib\urllib.py", line 206, in open
        return getattr(self, name)(url)
      File "e:\python-dev\trunk\lib\urllib.py", line 464, in open_file
        return self.open_local_file(url)
      File "e:\python-dev\trunk\lib\urllib.py", line 478, in open_local_file
        raise IOError(e.errno, e.strerror, e.filename)
    IOError: [Errno 22] ネットワークに到達できません。ネットワークのトラブル
    シューテ
    ィングについては、Windows ヘルプを参照してください。:
    '\\\\\\E|\\python-dev\\tru
    nk\\Lib\\test\\@test'

    (snip)

    This happens since r71780. Workaround is to add "|" to safe list of
    fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")

    # I don't know "|" is really safe.

    @ocean-city ocean-city mannequin added the stdlib Python modules in the Lib dir label Apr 28, 2009
    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Apr 28, 2009

    Python 2.7a0 (trunk, Apr 28 2009, 10:23:56) [MSC v.1200 32 bit (Intel)]
    on win32

    Type "help", "copyright", "credits" or "license" for more information.
    >>> import urllib
    >>> urllib.pathname2url("c:/foo")
    '///C|//foo'

    When "|" above is quoted, urllib.urlopen cannot handle quoted url.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Apr 28, 2009

    Or another workaround is to change line "path = '///' + drive + '|' "
    from file ./Lib/nturl2path.py, i.e. '|' -> ':' .

    @orsenthil
    Copy link
    Member

    I had made that change. tested only linux, where it was all pass. Shall
    address this one soon.

    @orsenthil orsenthil self-assigned this May 1, 2009
    @orsenthil
    Copy link
    Member

    Fixed this in the revision: 72343. Agree to the comment on replacing '|'
    to ':' in pathname2url as windows recognizes it. test_urllib passes.

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant