Merge lp:~sil2100/ubuntu-archive-tools/plus-sign-review into lp:ubuntu-archive-tools

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 1114
Proposed branch: lp:~sil2100/ubuntu-archive-tools/plus-sign-review
Merge into: lp:ubuntu-archive-tools
Diff against target: 33 lines (+3/-4)
1 file modified
sru-review (+3/-4)
To merge this branch: bzr merge lp:~sil2100/ubuntu-archive-tools/plus-sign-review
Reviewer Review Type Date Requested Status
Ubuntu Package Archive Administrators Pending
Review via email: mp+328449@code.launchpad.net

Commit message

Stop urlencoding source package name in sru-review when trying to access the debdiff as it makes it impossible to review packages with + in the name.

Description of the change

Do we really need to urlencode the source package name? In the current state it just makes the script not be able to access the debdiff, e.g.:
http://launchpadlibrarian.net/330880566/gtk+2.0_2.24.30-1ubuntu1.16.04.1_2.24.30-1ubuntu1.16.04.2.diff.gz

With quote() being used, the regexp cannot find the link in the queue webpage contents as the + sign is urlencoded. I wonder why this was added in the first place? Did something change in how links to the librarian are used?

To post a comment you must log in.
1115. By Łukasz Zemczak

Remove whitespace.

Revision history for this message
Colin Watson (cjwatson) wrote :

FWIW, the thing that changed was https://code.launchpad.net/~wgrant/launchpad/bug-677270/+merge/279974. Strictly speaking, to match that you ought to use quote(sourcepkg, safe='/~+'), but it makes no difference since there are no longer any characters that are legal in source package names and that are escaped in librarian URLs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sru-review'
2--- sru-review 2017-06-30 15:21:47 +0000
3+++ sru-review 2017-08-02 14:40:44 +0000
4@@ -37,10 +37,9 @@
5 import sys
6 import tempfile
7 try:
8- from urllib.parse import quote
9 from urllib.request import urlopen, urlretrieve
10 except ImportError:
11- from urllib import quote, urlopen, urlretrieve
12+ from urllib import urlopen, urlretrieve
13 import webbrowser
14
15 from launchpadlib.launchpad import Launchpad
16@@ -158,7 +157,7 @@
17 debdiff_re = re.compile(
18 'href="(http://launchpadlibrarian.net/'
19 '\d+/%s_[^"_]+_[^_"]+\.diff\.gz)">\s*diff from' %
20- re.escape(quote(sourcepkg)))
21+ re.escape(sourcepkg))
22
23 queue_html = urlopen(queue_url).read()
24
25@@ -186,7 +185,7 @@
26 '''
27 changes_re = re.compile(
28 'href="(https://launchpad.net/[^ "]+/%s_[^"]+_source.changes)"' %
29- re.escape(quote(sourcepkg)))
30+ re.escape(sourcepkg))
31 sourcepub_re = re.compile(
32 'href="(\+sourcepub/\d+/\+listing-archive-extra)"')
33 #debdiff_re = re.compile(

Subscribers

People subscribed via source and target branches