This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients kulikjak, vstinner
Date 2019-06-26.11:44:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561549448.74.0.772013339791.issue37335@roundup.psfhosted.org>
In-reply-to
Content
>  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
History
Date User Action Args
2019-06-26 11:44:08vstinnersetrecipients: + vstinner, kulikjak
2019-06-26 11:44:08vstinnersetmessageid: <1561549448.74.0.772013339791.issue37335@roundup.psfhosted.org>
2019-06-26 11:44:08vstinnerlinkissue37335 messages
2019-06-26 11:44:08vstinnercreate