projects
/
twitter-api-cdsw-solutions
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
628c9a0
)
Switched to stdout codec, and switched ignore to replace. This could be a teaching...
author
Tommy Guy
<richardtguy84@gmail.com>
Mon, 20 Apr 2015 23:36:48 +0000
(16:36 -0700)
committer
Tommy Guy
<richardtguy84@gmail.com>
Mon, 20 Apr 2015 23:36:48 +0000
(16:36 -0700)
tweepy/models.py
patch
|
blob
|
history
diff --git
a/tweepy/models.py
b/tweepy/models.py
index 0db677ea140c6fe49a70ed0a464368c0eb4e4122..af80986ba6b2bdc0e337567cf7f3ee608ca14ff6 100644
(file)
--- a/
tweepy/models.py
+++ b/
tweepy/models.py
@@
-77,9
+77,10
@@
class Status(Model):
status = cls(api)
# I'm not proud. Blame billg.
status = cls(api)
# I'm not proud. Blame billg.
- json['text'] = str(json['text'].encode('ascii', 'ignore'))[2:-1]
+ import sys
+ json['text'] = str(json['text'].encode(sys.stdout.encoding, 'replace'))[2:-1]
if 'user' in json:
if 'user' in json:
- json['user']['screen_name'] = str(json['user']['screen_name'].encode(
'ascii', 'ignor
e'))[2:-1]
+ json['user']['screen_name'] = str(json['user']['screen_name'].encode(
sys.stdout.encoding, 'replac
e'))[2:-1]
setattr(status, '_json', json)
for k, v in json.items():
setattr(status, '_json', json)
for k, v in json.items():
Benjamin Mako Hill
||
Want to submit a patch?