SourceForge.getRemoteProduct() returns an ASCII string; Product.remote_product expects unicode

Bug #335607 reported by Graham Binns
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Colin Watson

Bug Description

There are errors in the update-remote-product output due to an encoding error with the SourceForge ExternalBugTracker:

Traceback (most recent call last):
  File "cronscripts/update-remote-product.py", line 31, in ?
    script.lock_and_run()
  File "/srv/launchpad.net/production/launchpad-rev-7763/utilities/../lib/canonical/launchpad/scripts/base.py", line 272, in lock_and_run
    implicit_begin=implicit_begin, isolation=isolation)
  File "/srv/launchpad.net/production/launchpad-rev-7763/utilities/../lib/canonical/launchpad/scripts/base.py", line 232, in run
    self.main()
  File "cronscripts/update-remote-product.py", line 22, in main
    updater.update()
  File "/srv/launchpad.net/production/launchpad-rev-7763/cronscripts/../lib/canonical/launchpad/scripts/updateremoteproduct.py", line 39, in update
    self.updateByBugTrackerType(bugtracker_type)
  File "/srv/launchpad.net/production/launchpad-rev-7763/cronscripts/../lib/canonical/launchpad/scripts/updateremoteproduct.py", line 91, in updateByBugTrackerType
    product.remote_product = remote_product
  File "/srv/launchpad.net/production/launchpad-rev-7763/utilities/../lib/storm/properties.py", line 67, in __set__
    obj_info.variables[column].set(value)
  File "/srv/launchpad.net/production/launchpad-rev-7763/utilities/../lib/storm/variables.py", line 397, in parse_set
    raise TypeError("Expected unicode, found %r: %r"
TypeError: Expected unicode, found <type 'str'>: '100894&659341'

This is because SourceForge.getRemoteProduct() returns an ASCII string instead of a unicode one.

The best thing to do is probably to make sure that the remote product is a unicode string before setting it in the update-remote-product script. This will ensure that the problem doesn't occur for any other bug tracker type in the future.

Graham Binns (gmb)
Changed in malone:
assignee: nobody → gmb
importance: Undecided → Medium
milestone: none → 2.2.3
status: New → Triaged
Changed in malone:
assignee: gmb → nobody
milestone: 2.2.3 → 2.2.4
Changed in malone:
milestone: 2.2.4 → 2.2.5
Changed in malone:
milestone: 2.2.5 → none
Curtis Hovey (sinzui)
Changed in launchpad:
importance: Medium → Low
Revision history for this message
Colin Watson (cjwatson) wrote :

I'm not sure this was ever fixed directly, but it was effectively fixed as part of porting to Python 3: when running on Python 3, the `str` object returned by `SourceForge.getRemoteProduct` is a Unicode object.

Changed in launchpad:
assignee: nobody → Colin Watson (cjwatson)
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.