Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1787227 - python3-urllib3 1.25.1 fails to parse URLs with brackets
Summary: python3-urllib3 1.25.1 fails to parse URLs with brackets
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: python3-urllib3
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-01 18:20 UTC by Ewoud Kohl van Wijngaarden
Modified: 2020-02-24 01:05 UTC (History)
2 users (show)

Fixed In Version: python3-urllib3-1.25.6-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-24 01:05:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ewoud Kohl van Wijngaarden 2020-01-01 18:20:36 UTC
Description of problem:

When performing a request to a URL with a special character, it fails to parse.


Version-Release number of selected component (if applicable):

python36-urllib3 1.25.1-1.el7


How reproducible:

Always.


Steps to Reproduce:
1. Install python36-urllib3 1.25.1-1.el7
2. python3 -c "import requests ; requests.get('http://example.com/api/json?tree=jobs[x]')"


Actual results:

# python3 -c "import requests ; requests.get('http://example.com/api/json?tree=jobs[x]')"
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 374, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/url.py", line 212, in parse_url
    six.raise_from(LocationParseError(url), None)
  File "<string>", line 3, in raise_from
requests.packages.urllib3.exceptions.LocationParseError: Failed to parse: http://example.com/api/json?tree=jobs[x]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 448, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 302, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 376, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://example.com/api/json?tree=jobs[x]


Expected results:

Valid request


Additional info:

Upstream this is fixed in https://github.com/urllib3/urllib3/pull/1586 and part of 1.25.2. Manually applying the patch fixes the issue.

Comment 1 Fedora Update System 2020-02-08 21:53:55 UTC
FEDORA-EPEL-2020-7894ebebfb has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-7894ebebfb

Comment 2 Fedora Update System 2020-02-09 01:48:10 UTC
python3-six-1.12.0-1.el7, python3-urllib3-1.25.6-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-7894ebebfb

Comment 3 Fedora Update System 2020-02-24 01:05:00 UTC
python3-six-1.12.0-1.el7, python3-urllib3-1.25.6-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.