STINNER Victor <[email protected]> added the comment:
> what you propose is to rewrite current replaces to use
> "codecs.lookup(encoding).name" instead and then push it into the master?
I suggest to remove the code which does the .replace(), but instead normalize
the encoding when checking for the expected encoding (near .assertEqual()). I
still see the .replace() code in master, so yeah, the code should first be
changed in master:
@staticmethod
def _handle_output_variations(data):
"""Adjust the output to handle platform specific idiosyncrasies
* Some platforms report ASCII as ANSI_X3.4-1968
* Some platforms report ASCII as US-ASCII
* Some platforms report UTF-8 instead of utf-8
"""
data = data.replace(b"ANSI_X3.4-1968", b"ascii")
data = data.replace(b"US-ASCII", b"ascii")
data = data.lower()
return data
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37335>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com