Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Liberapay running on python3 #88

Merged
merged 29 commits into from
Oct 2, 2016
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c725412
python3 compat in crypto module
Changaco Aug 27, 2016
d90ff56
use tox to test both python 2 and 3 on Travis
Changaco Aug 27, 2016
4718e32
move fake-factory dependency to where it belongs
Changaco Aug 27, 2016
8b51387
HTTP headers should always be bytestrings
Changaco Aug 27, 2016
0bbf499
upgrade raven (from 3.1.4 to 5.25.0!)
Changaco Aug 27, 2016
c9ac08d
fix hashing of email addresses for gravatar IDs
Changaco Aug 27, 2016
c9600a8
b64encode always manipulates bytes
Changaco Aug 27, 2016
35270fd
the stdlib cookies expects `str`
Changaco Aug 27, 2016
23892cf
make CSV renderer compatible with python3
Changaco Aug 27, 2016
cb8999d
update code for parsing of email simplates
Changaco Aug 27, 2016
3c30652
response.body → response.text
Changaco Aug 27, 2016
c6666e8
can't compare `None` to `int` in python3
Changaco Aug 27, 2016
c1a71b9
function keywords need to be strings
Changaco Aug 27, 2016
34aa8ec
compatible imports from urllib using six
Changaco Aug 27, 2016
e44a97e
quote user names when building URLs
Changaco Aug 27, 2016
f91bcd9
fix b64decode_s
Changaco Aug 27, 2016
7a6d18e
python3 doesn't leak exceptions
Changaco Aug 27, 2016
adc02b9
fix a couple of tests
Changaco Aug 27, 2016
0afecdd
update cookie test to ignore letter casing
Changaco Aug 27, 2016
84d7151
AssertionError.{message → msg}
Changaco Aug 27, 2016
d692e98
body of test request needs to be bytes
Changaco Aug 27, 2016
cb401c8
read JS files as utf8
Changaco Aug 27, 2016
78105d2
fix TypeError
Changaco Aug 27, 2016
6080f83
make py2 variable cleanup compatible with py3
Changaco Aug 27, 2016
d18e46c
tweak unpickling to work with memory views
Changaco Aug 27, 2016
10966f1
upgrade python-mimeparse to 1.5.2
Changaco Aug 28, 2016
b6ba344
get python 3.5 on Travis
Changaco Oct 1, 2016
32cdb39
speed up DB initialization on Travis
Changaco Oct 1, 2016
c763080
also run flake8 under Tox
Changaco Oct 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix hashing of email addresses for gravatar IDs
  • Loading branch information
Changaco committed Oct 1, 2016
commit c9ac08d2e2be182bc08b3cadd8fd119970a5cf87
3 changes: 2 additions & 1 deletion liberapay/elsewhere/_base.py
Original file line number Diff line number Diff line change
@@ -200,7 +200,8 @@ def extract_user_info(self, info):
if not r.avatar_url:
gravatar_id = self.x_gravatar_id(r, info, None)
if r.email and not gravatar_id:
gravatar_id = hashlib.md5(r.email.strip().lower()).hexdigest()
bs = r.email.strip().lower().encode('utf8')
gravatar_id = hashlib.md5(bs).hexdigest()
if gravatar_id:
r.avatar_url = 'https://seccdn.libravatar.org/avatar/'+gravatar_id
r.is_team = self.x_is_team(r, info, False)
2 changes: 1 addition & 1 deletion liberapay/models/participant.py
Original file line number Diff line number Diff line change
@@ -1040,7 +1040,7 @@ def update_avatar(self, src=None, cursor=None):
if platform == 'libravatar' or platform is None and email:
if not email:
return
avatar_id = md5(email.strip().lower()).hexdigest()
avatar_id = md5(email.strip().lower().encode('utf8')).hexdigest()
avatar_url = 'https://seccdn.libravatar.org/avatar/'+avatar_id
avatar_url += AVATAR_QUERY