fix unicode bug in Python 3
authorOrakaro <nhatminh_179@hotmail.com>
Wed, 6 Aug 2014 14:12:11 +0000 (23:12 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Wed, 6 Aug 2014 14:12:11 +0000 (23:12 +0900)
docs/conf.py
rainbowstream/py3patch.py
rainbowstream/rainbow.py
setup.py

index aedd8b242fe8f3e6c6247176fb23c98c22f5389a..1ba586b720acebfdfaca71bd4c71953087a9af2f 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '0.6.5'
+version = '0.6.6'
 # The full version, including alpha/beta/rc tags.
-release = '0.6.5'
+release = '0.6.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index adfbff281ebe64f1bb52b1b6fa7aa792cfddba48..616465eb5e7be241d97e621833dfc40da14206c7 100644 (file)
@@ -23,6 +23,9 @@ unescape = HTMLParser().unescape
 # raw_input and map function behaviour
 if sys.version[0] == "2":
     lmap = lambda f, a: map(f, a)
+    unc = lambda x: x.decode('utf-8')
 else:
     raw_input = input
     lmap = lambda f, a: list(map(f, a))
+    unc = lambda x: x
+
index 95461788e9961cce9375639fe623f30a04132e7a..8760e7830a228d81b221074f2e0fccf07e272318 100644 (file)
@@ -445,7 +445,7 @@ def reply():
     tid = c['tweet_dict'][id]
     user = t.statuses.show(id=tid)['user']['screen_name']
     status = ' '.join(g['stuff'].split()[1:])
-    status = '@' + user + ' ' + status.decode('utf-8')
+    status = '@' + user + ' ' + unc(status)
     t.statuses.update(status=status, in_reply_to_status_id=tid)
 
 
@@ -744,7 +744,7 @@ def mute():
             rel = t.mutes.users.create(screen_name=screen_name[1:])
             if isinstance(rel, dict):
                 printNicely(green(screen_name + ' is muted.'))
-                c['IGNORE_LIST'] += [screen_name.decode('utf8')]
+                c['IGNORE_LIST'] += [unc(screen_name)]
                 c['IGNORE_LIST'] = list(set(c['IGNORE_LIST']))
             else:
                 printNicely(red(rel))
index c9bd0ebb0f9b4a3cbed75871cb74199d0fa3bab6..642440e349dfb16a05f7135712d02f1c59c6578e 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '0.6.5'
+version = '0.6.6'
 
 # Require
 install_requires = [