Rencode module now always loads strings as utf-8 encoded byte strings.
This commit is contained in:
parent
4f59a48f57
commit
6b5cf3396d
|
@ -159,12 +159,6 @@ def decode_string(x, f):
|
|||
raise ValueError
|
||||
colon += 1
|
||||
s = x[colon:colon+n]
|
||||
try:
|
||||
t = s.decode("utf8")
|
||||
if len(t) != len(s):
|
||||
s = t
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
return (s, colon+n)
|
||||
|
||||
def decode_list(x, f):
|
||||
|
|
Loading…
Reference in New Issue