Person.__repr__ causes an oops masking the real error because displayname is unicode

Bug #575976 reported by Diogo Matsubara on 2010-05-05
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Curtis Hovey

Bug Description

As seen on OOPS-1582EB1587 a UnicodeEncodeError was raised while GET'ing the +reviewaccount page for a person and the person display name contains non-ascii characters.

Related branches

Curtis Hovey (sinzui) wrote :

The oops was created *after* the canonical_urldata_iterator raised its own error because henninge hacked the URL to non-existant person. The error message wanted to tell henninge to be a good boy, but the NoCanonicalUrl uses the __repr__ of the object, which for many launchpad objects, will contain unicode.

summary: - +reviewaccount page oopses with a UnicodeEncodeError if the display name
- contains non-ascii characters
+ Person.__repr__ causes an oops masking the real error because
+ displayname is unicode
Changed in launchpad-registry:
importance: Undecided → Low
status: New → Triaged
Curtis Hovey (sinzui) wrote :

Sweet apparently this is a Python 2.5 issue that we need to hack around if we want this fixed now.

Curtis Hovey (sinzui) wrote :

We can use canonical.launchpad.helpers.backslashreplace(self.displayname) to make the name safe.

This affects the following models:

Account is under discussion for removal. Account by the way is what henninge was try to hack, but Person got in the way, or more to the point, did nto exist to get in the way for the URL to work.

tags: added: trivial
Changed in launchpad-registry:
milestone: none → series-future
Diogo Matsubara (matsubara) wrote :

Would this fix also fix bug 191945 ? It looks like it would given Barry's suggestion on 191945, so I'm in favor to dupe this one against 191945 or the other way around.
Do you agree Curtis?

Curtis Hovey (sinzui) wrote :

I could if we added email address to the list. Earch __repr__ needs a hack based on our understanding the field permits unicode.

Curtis Hovey (sinzui) wrote :

Sorry. I did not finish my thought. We do not own email address anymore, It is SSO I think, and I am note sure if our implementation is to be removed. Account is a table that has been decided must be removed. It does no harm in fixing it even if it gets removed.

Curtis Hovey (sinzui) on 2010-05-07
Changed in launchpad-registry:
milestone: series-future → 10.05
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui) on 2010-05-12
Changed in launchpad-registry:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2010-05-13
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui) on 2010-06-02
Changed in launchpad-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers