Merge lp:~xnox/ubuntu-archive-tools/unbreak-nusakan into lp:ubuntu-archive-tools

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 1258
Proposed branch: lp:~xnox/ubuntu-archive-tools/unbreak-nusakan
Merge into: lp:ubuntu-archive-tools
Diff against target: 15 lines (+5/-1)
1 file modified
qatracker.py (+5/-1)
To merge this branch: bzr merge lp:~xnox/ubuntu-archive-tools/unbreak-nusakan
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+376993@code.launchpad.net

Commit message

import qatracker
tracker=qatracker.QATracker("http://iso.qa.ubuntu.com/xmlrpc.php")
milestones=tracker.get_milestones('Testing')
for m in milestones:
    m.get_builds(0)

Is currently broken, because a build.note in bionic currently contains unicode which is attempted to be cast to python2 ascii string on nusakan, resulting in failing to post bionic images to the iso tracker.

See traceback at the end of https://people.canonical.com/~ubuntu-archive/cd-build-logs/ubuntu-server/bionic/daily-20191219.log

Please merge this & deploy it to nusakan

Traceback (most recent call last):
  File "/srv/cdimage.ubuntu.com/bin/../lib/cdimage/tree.py", line 2522, in post_qa
    tracker.post_build(product[0], date, note=note)
  File "/srv/cdimage.ubuntu.com/ubuntu-archive-tools/isotracker.py", line 164, in post_build
    if milestone.add_build(product, version, note, notify):
  File "/srv/cdimage.ubuntu.com/ubuntu-archive-tools/qatracker.py", line 239, in add_build
    for entry in self.get_builds(0):
  File "/srv/cdimage.ubuntu.com/ubuntu-archive-tools/qatracker.py", line 259, in get_builds
    builds.append(QATrackerBuild(self.tracker, entry))
  File "/srv/cdimage.ubuntu.com/ubuntu-archive-tools/qatracker.py", line 80, in __init__
    setattr(self, key, str(rpc_dict[key]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0141' in position 445: ordinal not in range(128)

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

reported by paride

Revision history for this message
Steve Langasek (vorlon) wrote :

I hate that we're making the code more complicated rather than just moving everything to python3.

review: Approve
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Should I quickly force cdimage to use python3? And like upgrade it to bionic?

I guess we could refactor cdimage to not use qatracker as a library, but call it as a binary. Then we could keep qatracker as python3.

Revision history for this message
Steve Langasek (vorlon) wrote :

On Thu, Dec 19, 2019 at 04:30:25PM -0000, Dimitri John Ledkov wrote:

> Should I quickly force cdimage to use python3? And like upgrade it to
> bionic?

No. I said I hate that we're doing it, but note that I approved, merged,
and deployed this anyway.

But the cdimage code itself has been bilingual for a while, and it should be
possible to switch the codebase to python3 now on the existing xenial host.
I would've been in favor of doing this now, except ubuntu-archive-tools is
*not* python3-safe and there are other commands calling into
isotracker.py/qatracker.py in that code base which would need porting first.

> I guess we could refactor cdimage to not use qatracker as a library, but
> call it as a binary. Then we could keep qatracker as python3.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
<email address hidden> <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qatracker.py'
--- qatracker.py 2013-06-25 19:24:49 +0000
+++ qatracker.py 2019-12-19 15:19:42 +0000
@@ -77,7 +77,11 @@
77 except ValueError:77 except ValueError:
78 setattr(self, key, None)78 setattr(self, key, None)
79 else:79 else:
80 setattr(self, key, str(rpc_dict[key]))80 import sys
81 if sys.version_info > (3,):
82 setattr(self, key, str(rpc_dict[key]))
83 else:
84 setattr(self, key, unicode(rpc_dict[key]))
8185
82 self.tracker = tracker86 self.tracker = tracker
8387

Subscribers

People subscribed via source and target branches