Private GIT

Skip to content
Snippets Groups Projects
Commit b67c186e authored by echel0n's avatar echel0n
Browse files

Fixed startup issue for python 2.6 end-users, had to make some compatibility...

Fixed startup issue for python 2.6 end-users, had to make some compatibility changes to the ftfy libs
parent 9a33ddf8
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ def make_sloppy_codec(encoding): ...@@ -94,7 +94,7 @@ def make_sloppy_codec(encoding):
# Get a list of what they decode to in the given encoding. Use the # Get a list of what they decode to in the given encoding. Use the
# replacement character for unassigned bytes. # replacement character for unassigned bytes.
decoded_chars = all_bytes.decode(encoding, errors='replace') decoded_chars = all_bytes.decode(encoding, 'replace')
# Update the sloppy_chars list. Each byte that was successfully decoded # Update the sloppy_chars list. Each byte that was successfully decoded
# gets its decoded value in the list. The unassigned bytes are left as # gets its decoded value in the list. The unassigned bytes are left as
......
...@@ -39,7 +39,7 @@ def _build_regexes(): ...@@ -39,7 +39,7 @@ def _build_regexes():
# bytes 0x80-0xff in this character set. (This uses the fact that all # bytes 0x80-0xff in this character set. (This uses the fact that all
# regex special characters are ASCII, and therefore won't appear in the # regex special characters are ASCII, and therefore won't appear in the
# string.) # string.)
regex = '^[\x00-\x7f{}]*$'.format(charlist) regex = '^[\x00-\x7f{0}]*$'.format(charlist)
encoding_regexes[encoding] = re.compile(regex) encoding_regexes[encoding] = re.compile(regex)
return encoding_regexes return encoding_regexes
ENCODING_REGEXES = _build_regexes() ENCODING_REGEXES = _build_regexes()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment