#1542 Ensure the email sent to be converted to avatar is proper utf-8
Merged by pingou. Opened by pingou.
fix_avatar_encoding  into  master

Download 1542.patch
no initial comment

rebased

:+1: here.

Any tests for this one?

I can try to look up something, give me a few :)

I will say that the most painless way to handle encoding is to do it on the edges of everything. That is to say, any data coming into the application should immediately be decoded to unicode, and only re-encoded by whatever is sending out into the world again (via a file, or over the network, or whatever). That way you are free to assume everything internally is unicode, and you have very few places to worry about doing the encode/decode dance.

I don't have a very good sense of how this filter gets used, but having it have a side-effect like this could to be very painful if we ever want to use Python 3.

1 new commit added

  • Move the encoding to the backend so it is done once for all the calls

1 new commit added

  • Add unit-tests for pagure.lib.avatar_url_from_openid using an unicode string

rebased

Tests added :)

rebased

1 new commit added

  • Start the unit-tests module for pagure.ui.filters

This variable name is a misnomer (if it isn't, you're doing the wrong thing, since an OpenID identity is a URL, and URLs are never utf8-encoded, only %-encoded).

rebased

:thumbsup_tone3:

Pull-Request has been merged by pingou

Metadata