Audit all strings in djblets and convert to __future__.unicode_literals
Review Request #4944 — Created Nov. 12, 2013 and submitted — Latest diff uploaded
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).
- Verified my assumptions about treatment of
unicode
vs.str
ingetattr
,
hasattr
,delattr
,__getattr__
,__hasattr__
,__delattr__
,hash
, regular
expressions, and memcache keys. - Ran djblets unit tests
- Ran Review Board unit tests
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.
djblets/__init__.py |
---|
djblets/settings.py |
---|
djblets/auth/forms.py |
---|
djblets/auth/util.py |
---|
djblets/auth/views.py |
---|
djblets/datagrid/grids.py |
---|
djblets/datagrid/tests.py |
---|
djblets/datagrid/templatetags/datagrid.py |
---|
djblets/extensions/admin.py |
---|
djblets/extensions/errors.py |
---|
djblets/extensions/extension.py |
---|
djblets/extensions/hooks.py |
---|
djblets/extensions/loaders.py |
---|
djblets/extensions/manager.py |
---|
djblets/extensions/middleware.py |
---|
djblets/extensions/packaging.py |
---|
djblets/extensions/resources.py |
---|
djblets/extensions/settings.py |
---|
djblets/extensions/signals.py |
---|
djblets/extensions/staticfiles.py |
---|