community-contributions.py script erroring on some Unicode (?) input

Bug #432742 reported by Karl Fogel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Karl Fogel

Bug Description

If utilities/community-contributions.py gets certain kinds of input, a bug in either editmoin.py (the old version we're using), or in urllib, or in both, will cause this traceback:

  Traceback (most recent call last):
    File "./community-contributions.py", line 409, in <module> main()
    File "./community-contributions.py", line 401, in main
      editfile_func=update_if_modified)
    File "/home/kfogel/lp-branches/devel/utilities/editmoin.py", line 396, in editshortcut
      sendfile(urlopener, url, moinfile)
    File "/home/kfogel/lp-branches/devel/utilities/editmoin.py", line 328, in sendfile
      % (urllib.quote(moinfile.body), comment)
    File "/usr/lib/python2.5/urllib.py", line 1205, in quote
      res = map(safe_map.__getitem__, s)
  KeyError: u'\u0434'

To reproduce, simply remove the Cyrillic versions of Danilo Šegan's name ("Данило Шеган", "данило шеган") from the 'known_canonical_devs' tuple, and run the script *without* the '--dry-run' option (i.e., you have to actually invoke editmoin to get the bug to show up).

The workaround for now is that Danilo needs to be in that list anyway, and I've prepared that change in https://code.edge.launchpad.net/~kfogel/launchpad/cc-script-update-reference/+merge/12102.

However, eventually some other contributor will come along with a non-ASCII name, and we'll have this problem again.

Karl Fogel (kfogel)
Changed in launchpad:
assignee: nobody → Karl Fogel (kfogel)
Karl Fogel (kfogel)
Changed in launchpad:
importance: Undecided → Low
affects: launchpad → launchpad-foundations
Gary Poster (gary)
Changed in launchpad-foundations:
status: New → Triaged
Revision history for this message
Karl Fogel (kfogel) wrote :

Fix committed in various commits on the https://code.edge.launchpad.net/~kfogel/launchpad/cc-script-new-world branch.

Changed in launchpad-foundations:
status: Triaged → Fix Committed
Revision history for this message
Karl Fogel (kfogel) wrote :

This change has landed. I'm marking as "Fix Released" because it's on devpad now and the cron job there that updates https://dev.launchpad.net/Contributions is using the latest version.

Changed in launchpad-foundations:
status: Fix Committed → Fix Released
Deryck Hodge (deryck)
Changed in launchpad-foundations:
milestone: none → 10.02
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.