launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26255
[Merge] ~cjwatson/launchpad:py3-externalbugtracker-decode-responses into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-externalbugtracker-decode-responses into launchpad:master.
Commit message:
Decode external bug tracker responses where needed
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397701
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-externalbugtracker-decode-responses into launchpad:master.
diff --git a/lib/lp/bugs/externalbugtracker/mantis.py b/lib/lp/bugs/externalbugtracker/mantis.py
index 6021f37..69781a4 100644
--- a/lib/lp/bugs/externalbugtracker/mantis.py
+++ b/lib/lp/bugs/externalbugtracker/mantis.py
@@ -249,7 +249,7 @@ class Mantis(ExternalBugTracker):
# MANTIS_VIEW_ALL_COOKIE set in the previous step to specify
# what's being viewed.
try:
- csv_data = self._getPage("csv_export.php").content
+ csv_data = self._getPage("csv_export.php").text
except BugTrackerConnectError as value:
# Some Mantis installations simply return a 500 error
# when the csv_export.php page is accessed. Since the
@@ -304,7 +304,7 @@ class Mantis(ExternalBugTracker):
# _checkForApplicationError) then we could be much more
# specific than this.
bug_page = BeautifulSoup(
- self._getPage('view.php?id=%s' % bug_id).content,
+ self._getPage('view.php?id=%s' % bug_id).text,
parse_only=SoupStrainer('table'))
app_error = self._checkForApplicationError(bug_page)
diff --git a/lib/lp/bugs/externalbugtracker/roundup.py b/lib/lp/bugs/externalbugtracker/roundup.py
index 66f46ca..fc3f0a7 100644
--- a/lib/lp/bugs/externalbugtracker/roundup.py
+++ b/lib/lp/bugs/externalbugtracker/roundup.py
@@ -218,7 +218,8 @@ class Roundup(ExternalBugTracker):
"""See `ExternalBugTracker`."""
bug_id = int(bug_id)
query_url = self.getSingleBugExportURL(bug_id)
- reader = csv.DictReader(self._getPage(query_url).iter_lines())
+ reader = csv.DictReader(
+ self._getPage(query_url).iter_lines(decode_unicode=True))
return (bug_id, next(reader))
def getRemoteBugBatch(self, bug_ids):
@@ -230,7 +231,8 @@ class Roundup(ExternalBugTracker):
# export the bug ids needed rather than hitting the remote
# tracker for a potentially massive number of bugs.
query_url = self.getBatchBugExportURL()
- remote_bugs = csv.DictReader(self._getPage(query_url).iter_lines())
+ remote_bugs = csv.DictReader(
+ self._getPage(query_url).iter_lines(decode_unicode=True))
bugs = {}
for remote_bug in remote_bugs:
# We're only interested in the bug if it's one of the ones in
diff --git a/lib/lp/bugs/externalbugtracker/sourceforge.py b/lib/lp/bugs/externalbugtracker/sourceforge.py
index fdc7441..1d259c8 100644
--- a/lib/lp/bugs/externalbugtracker/sourceforge.py
+++ b/lib/lp/bugs/externalbugtracker/sourceforge.py
@@ -49,7 +49,7 @@ class SourceForge(ExternalBugTracker):
for bug_id in bug_ids:
query_url = self.export_url % bug_id
- page_data = self._getPage(query_url).content
+ page_data = self._getPage(query_url).text
soup = BeautifulSoup(page_data)
status_tag = soup.find(text=re.compile('Status:'))
diff --git a/lib/lp/bugs/externalbugtracker/trac.py b/lib/lp/bugs/externalbugtracker/trac.py
index ab36b7e..3bb303a 100644
--- a/lib/lp/bugs/externalbugtracker/trac.py
+++ b/lib/lp/bugs/externalbugtracker/trac.py
@@ -150,7 +150,8 @@ class Trac(ExternalBugTracker):
"""
# We read the remote bugs into a list so that we can check that
# the data we're getting back from the remote server are valid.
- csv_reader = csv.DictReader(self._getPage(query_url).iter_lines())
+ csv_reader = csv.DictReader(
+ self._getPage(query_url).iter_lines(decode_unicode=True))
remote_bugs = [next(csv_reader)]
# We consider the data we're getting from the remote server to