Change Summary:
Fix the one place I seem to have misplaced the u ('u..'). Grepping indicates that I didn't make other mistakes.
Diff: |
Revision 2 (+1645 -1651) |
---|
Review Request #4944 — Created Nov. 12, 2013 and submitted
Audit all strings in djblets and convert to
__future__.unicode_literals
This change represents an audit of all of the strings in the djblets codebase.
Where the strings were actually binary data (specifically with our treatment of
settings.EMAIL_HOST_USER
andsettings.EMAIL_HOST_PASSWORD
, and anything passed
intosha1()
ormd5()
), I've made it use thebytes
type. Otherwise, these are
nowunicode
objects by virtue of importingunicode_literals
from__future__
.There's also a bunch of fixes to our handling of cache keys, especially those
for large data, much more consistent. We always keep the cache key as a unicode
object and create derivative keys (like the chunk keys for large data) with
that. At the last moment, before callingcache.get()
orcache.set()
, we pass
that tomake_cache_key
, which will shorten it if necessary using md5, and then
encode to utf-8 (since not all cache backends support the unicode object as
keys).
unicode
vs. str
in getattr
,hasattr
, delattr
, __getattr__
, __hasattr__
, __delattr__
, hash
, regularFix the one place I seem to have misplaced the u ('u..'). Grepping indicates that I didn't make other mistakes.
Diff: |
Revision 2 (+1645 -1651) |
---|
Add unicode_literals, undo the "u" prefixes, and fix a few bugs I found in the handling of strings in the large-data caching.
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+344 -194) |
Looks fine. Just one thing.
djblets/util/fields.py (Diff revision 4) |
---|
Shouldn't be necessary to put quotes around this.
%r
should take care of that.