From 84802da29b71679547ba245ea3d870512dba3b49 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 12 Feb 2017 11:26:31 +0000 Subject: [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. --- minify_web_js.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'minify_web_js.py') diff --git a/minify_web_js.py b/minify_web_js.py index 31b98ee33..d9a1643a9 100755 --- a/minify_web_js.py +++ b/minify_web_js.py @@ -15,7 +15,7 @@ Usage: python minify_web_js.py deluge/ui/web/js/deluge-all """ -from __future__ import print_function +from __future__ import print_function, unicode_literals import fileinput import fnmatch -- cgit v1.2.3