diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2017-02-12 12:26:31 +0100 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2017-02-22 13:36:32 +0100 |
commit | 84802da29b71679547ba245ea3d870512dba3b49 (patch) | |
tree | cc47027c315fff47d567745af381828afaed6a1b /generate_pot.py | |
parent | [#2879] [OSX] Fix dyld error opening file from within Deluge (diff) | |
download | deluge-84802da29b71679547ba245ea3d870512dba3b49.tar.xz deluge-84802da29b71679547ba245ea3d870512dba3b49.zip |
[Py2to3] Force unicode_literals and fix related issues
* Added `from __future__ import unicode_literals` to every file so
now all strings in code are forced to be unicode strings unless
marked as byte string `b'str'` or encoded to byte string `'str'.encode('utf-8')`.
This is a large change but we have been working towards the goal of unicode
strings passed in the code so decoding external input and encoding
output as byte strings (where applicable).
Note that in Python 2 the `str` type still refers to byte strings.
* Replaced the use of `str` for `basestring` in isinstance comparison as
this was the original intention but breaks code when encoutering unicode strings.
* Marked byte strings in gtkui as the conversion to utf8 is not always handled, mostly
related to gobject signal names.
Diffstat (limited to 'generate_pot.py')
-rwxr-xr-x | generate_pot.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generate_pot.py b/generate_pot.py index 0a871e1e1..6f510ac7e 100755 --- a/generate_pot.py +++ b/generate_pot.py @@ -11,7 +11,7 @@ """Parses Python and Javascript code for translation strings to create the 'deluge.pot' template for translators""" -from __future__ import print_function +from __future__ import print_function, unicode_literals import os import re |