Merge ~eole-team/ubuntu/+source/twisted:fix/twisted.web.twcgi-url-params-python3 into ubuntu/+source/twisted:applied/ubuntu/focal-proposed

Proposed by EOLE team
Status: Needs review
Proposed branch: ~eole-team/ubuntu/+source/twisted:fix/twisted.web.twcgi-url-params-python3
Merge into: ubuntu/+source/twisted:applied/ubuntu/focal-proposed
Diff against target: 17 lines (+2/-2)
1 file modified
src/twisted/web/twcgi.py (+2/-2)
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
git-ubuntu developers Pending
Review via email: mp+390233@code.launchpad.net

Commit message

twisted.web.twcgi can now handle url parameters in python 3.

This is a backport of https://github.com/twisted/twisted/commit/7f07f73bdfefab3ccd03ecfd3e95fd6c9b9db892

Description of the change

Under Python3, the query string is in bytes and the unquote is no more directly under urllib but under urllib.parse.

To post a comment you must log in.
Revision history for this message
EOLE team (eole-team) wrote :

Here is the upstream bug report https://www.twistedmatrix.com/trac/ticket/9887

Unmerged commits

e6c5d29... by Daniel Dehennin <email address hidden>

[PATCH] twisted.web.twcgi can now handle url parameters in python 3

Gbp-Pq: twisted.web.twcgi-handle-url-parameters-python3.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/twisted/web/twcgi.py b/src/twisted/web/twcgi.py
2index 1c92960..699e5f2 100644
3--- a/src/twisted/web/twcgi.py
4+++ b/src/twisted/web/twcgi.py
5@@ -109,10 +109,10 @@ class CGIScript(resource.Resource):
6 qargs = []
7 else:
8 qs = env['QUERY_STRING'] = request.uri[qindex+1:]
9- if '=' in qs:
10+ if b'=' in qs:
11 qargs = []
12 else:
13- qargs = [urllib.unquote(x) for x in qs.split('+')]
14+ qargs = [urllib.parse.unquote(x.decode()) for x in qs.split(b'+')]
15
16 # Propagate HTTP headers
17 for title, header in request.getAllHeaders().items():

Subscribers

People subscribed via source and target branches