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

Http redirection error in urllib2.py #42579

Closed
dehn mannequin opened this issue Nov 10, 2005 · 4 comments
Closed

Http redirection error in urllib2.py #42579

dehn mannequin opened this issue Nov 10, 2005 · 4 comments
Labels
stdlib Python modules in the Lib dir

Comments

@dehn
Copy link
Mannequin

dehn mannequin commented Nov 10, 2005

BPO 1353433
Nosy @birkenfeld, @vstinner
Files
  • urllib2.py: Python library source 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 = None
    closed_at = <Date 2019-04-10.09:13:08.271>
    created_at = <Date 2005-11-10.20:25:56.000>
    labels = ['library']
    title = 'Http redirection error in urllib2.py'
    updated_at = <Date 2019-04-10.09:13:08.271>
    user = 'https://bugs.python.org/dehn'

    bugs.python.org fields:

    activity = <Date 2019-04-10.09:13:08.271>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2005-11-10.20:25:56.000>
    creator = 'dehn'
    dependencies = []
    files = ['1832']
    hgrepos = []
    issue_num = 1353433
    keywords = []
    message_count = 4.0
    messages = ['26836', '26837', '26838', '339838']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'jjlee', 'vstinner', 'dehn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1353433'
    versions = ['Python 2.4']

    @dehn
    Copy link
    Mannequin Author

    dehn mannequin commented Nov 10, 2005

    A url request returns a redirect that contains a space ' '
    character. Python urllib2.py does not replace this
    character with '%20' and fails.

    Entering a line after line 507 of:
    newurl=re.sub(' ','%20',newurl)

    Corrects my problem.

    @dehn dehn mannequin closed this as completed Nov 10, 2005
    @dehn dehn mannequin closed this as completed Nov 10, 2005
    @dehn dehn mannequin added stdlib Python modules in the Lib dir labels Nov 10, 2005
    @jjlee
    Copy link
    Mannequin

    jjlee mannequin commented Feb 1, 2006

    Logged In: YES
    user_id=261020

    The problem is more general, so perhaps:

    URLQUOTE_SAFE_URL_CHARS = "!*'();:@&=+$,/?%#[]~"
    newurl = urllib.quote(url, URLQUOTE_SAFE_URL_CHARS)

    Caveat: I still haven't read RFCs 3986/3987...

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    Added a fix in rev. 43132.

    @vstinner
    Copy link
    Member

    Added a fix in rev. 43132.

    In Git, it became the commit:

    commit ddb84d7
    Author: Georg Brandl <georg@python.org>
    Date: Sat Mar 18 11:35:18 2006 +0000

    Bug bpo-1353433: be conciliant with spaces in redirect URLs
    

    @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

    2 participants