Merge lp:~brian-murray/errors/bucket-unicode-oops into lp:errors
Status: | Merged |
---|---|
Approved by: | Evan |
Approved revision: | 433 |
Merged at revision: | 434 |
Proposed branch: | lp:~brian-murray/errors/bucket-unicode-oops |
Merge into: | lp:errors |
Diff against target: |
22 lines (+4/-1) 1 file modified
errors/api/resources.py (+4/-1) |
To merge this branch: | bzr merge lp:~brian-murray/errors/bucket-unicode-oops |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Evan (community) | Approve | ||
Review via email: mp+168810@code.launchpad.net |
Commit message
Fix some unicode errors in the phased update regression detection code.
Description of the change
I was getting the following oops when testing the phased update regression detection code:
File "/usr/lib/
response = callback(request, *args, **kwargs)
File "/usr/lib/
return self.dispatch(
File "/var/www/
result = view(*args, **kwargs)
File "/var/www/
return Resource.
File "/usr/lib/
response = method(request, **kwargs)
File "/usr/lib/
to_
File "/usr/lib/
bundle.
File "/usr/lib/
return self.convert(
File "/usr/lib/
return unicode(value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 77: ordinal not in range(128)
This fixes that. A simple test is passing a unicode bucket to sha1:
In [1]: from hashlib import sha1
In [2]: sha1(u"
-------
UnicodeEncodeError Traceback (most recent call last)
<ipython-
----> 1 sha1(u"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 77: ordinal not in range(128)
Looks good to me.