mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 11:54:43 +00:00
squash! Python3: fix strformat ascii_safe() and unicode_safe()
This commit is contained in:
parent
ac14585a78
commit
1c2e6c465e
1 changed files with 2 additions and 1 deletions
|
|
@ -64,7 +64,8 @@ def unicode_safe (s, encoding=i18n.default_encoding, errors='replace'):
|
|||
return unicode(str(s), encoding, errors)
|
||||
except NameError: # Python3
|
||||
if isinstance(s, bytes):
|
||||
return s.decode("utf-8", errors)
|
||||
return s.decode(encoding, errors)
|
||||
return str(s)
|
||||
|
||||
|
||||
def ascii_safe (s):
|
||||
|
|
|
|||
Loading…
Reference in a new issue