Oops: user displayname has non-ascii value when setting the contact address field for a team

Bug #191945 reported by Nicolas Valcarcel
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

I'm trying to add my address as contact address of the Peruvian LoCo Council mailing list but i'm getting an error (last time it was OOPS-775EB177) and it doesn't let me change it.

Steps to reproduce:
1. Open http://launchpad.dev/%7Eubuntu-team/+contactaddress
2. Set "another e-mail address" to: fó@bar.com
3. Click Change
4. OOPS-775EB177 UnicodeEncodeError 'ascii' codec can't encode character u'\\xe1' in position 144: ordinal not in range(128)

Revision history for this message
Diogo Matsubara (matsubara) wrote : Re: Oops entering a non-ascii value in the contact address field for a team

salgado, can you take a look at this one?

description: updated
Changed in launchpad:
assignee: nobody → salgado
importance: Undecided → High
milestone: none → 1.2.2
status: New → Confirmed
Revision history for this message
Guilherme Salgado (salgado) wrote : Re: [Bug 191945] Re: Oops entering a non-ascii value in the contact address field for a team

Is this really a high priority one?

Revision history for this message
Stuart Bishop (stub) wrote : Re: Oops entering a non-ascii value in the contact address field for a team

Code to handle Unicode email addresses can be found at http://stuartbishop.net/Software/EmailAddress/index.html

However, the last time I went over the RFC's the example email address is invalid, as the account name portion should be US-ASCII. This is because the character set used to encode the account name is undefined. Some systems assume LATIN-1 so things appear to be ok, at least until they attempt to communicate with a system that assumes something else (UTF-8, ASCII, system locale). If this is no longer correct and the RFCs have been updated then it should be trivial to update the linked code to cope.

Revision history for this message
Stuart Bishop (stub) wrote :

Bouncing to Mr. Mailman for an opinion.

Unsetting milestone as this won't be a quick fix given the number of tests that will be needed.

Changed in launchpad:
assignee: salgado → barry
milestone: 1.2.2 → none
status: Confirmed → Incomplete
Revision history for this message
Henning Eggers (henninge) wrote :

I get the OOPS by just entering a normal email-address. The error seems to crop up when trying to display the error message. It seems NOT to be about the email address!

Anybody ever noticed, that the character in question u'\xe1' is _not_ ó but á? Same for me. I enter a valid email-addres and it complains about ü, which is not part of the address.

I just tried it out with <email address hidden> which seems to work. I suspect that some module produces a localised error message that cannot be encoded.

Revision history for this message
Henning Eggers (henninge) wrote :

This is strange. I cannot reproduce the error locally on launchpad.dev!

Entering fó@bar.com will correctly complain about "u'\xf3' in position 1". Entering "henning (AT) box25 (DOT) de" works just fine.

I hoped to be able to triage this but I have to give up here for now ...

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 191945] Re: Oops entering a non-ascii value in the contact address field for a team

On Wed, Nov 12, 2008 at 10:16:10AM -0000, Henning Eggers wrote:
> This is strange. I cannot reproduce the error locally on launchpad.dev!
>
> Entering fó@bar.com will correctly complain about "u'\xf3' in position
> 1". Entering "henning (AT) box25 (DOT) de" works just fine.
>
> I hoped to be able to triage this but I have to give up here for now ...

Looking at the OOPS (OOPS-775EB177) the user supplied an e-mail address
that was ASCII only. The OOPS happens when the code does a str(error),
and my guess would be that the error is something like:

    "The e-mail address is already used by Nicolas Valcárcel"

Thus str(error) fails, since the error message contains non-ascii
characters.

    subscribe bjornt

Revision history for this message
Barry Warsaw (barry) wrote : Re: Oops entering a non-ascii value in the contact address field for a team

Looks like Bjorn has the right diagnosis. There are several places where we don't properly handle non-ASCII in user's display names. This one should be fixed, but I'm not sure it's a high priority. OTOH, reviewers should really be watching for str'ing error messages, especially when users are involved.

We may also want to give persons a __str__() or __repr__() that DTRT.

Barry Warsaw (barry)
Changed in launchpad-registry:
importance: High → Medium
Curtis Hovey (sinzui)
Changed in launchpad-registry:
assignee: barry → nobody
importance: Medium → Low
status: Incomplete → Triaged
tags: removed: registry
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.