fix : AttributeError in Python3
fix : run python weixin.py then AttributeError: 'str' object has no attribute 'decode'
This commit is contained in:
@@ -1161,7 +1161,7 @@ class UnicodeStreamFilter:
|
|||||||
|
|
||||||
def write(self, s):
|
def write(self, s):
|
||||||
if type(s) == str:
|
if type(s) == str:
|
||||||
s = s.decode('utf-8')
|
s = s.encode().decode('utf-8')
|
||||||
s = s.encode(self.encode_to, self.errors).decode(self.encode_to)
|
s = s.encode(self.encode_to, self.errors).decode(self.encode_to)
|
||||||
self.target.write(s)
|
self.target.write(s)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user