From 1596f7869f0daae46792b221b15c6baad59c18ec Mon Sep 17 00:00:00 2001 From: Maks Verver Date: Thu, 29 Aug 2024 19:10:12 +0200 Subject: [PATCH] Fix issue #318: test failures when cchardet is installed feedparser imports cchardet or chardet depending on what's installed: https://github.com/kurtmckee/feedparser/blob/11990ea1d8791acc76c67781f1d2011daf0c3a99/feedparser/encodings.py#L37-L40 Although these libraries are mostly equivalent, they return slightly different encoding strings, even though both are correct and lead to succesful decoding. This change allows the tests to be run with either library by accepting both encoding names as correct. --- tests/illformed/chardet/big5.xml | 4 ++-- tests/illformed/chardet/euckr.xml | 4 ++-- tests/illformed/chardet/gb2312.xml | 2 +- tests/illformed/chardet/windows1255.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/illformed/chardet/big5.xml b/tests/illformed/chardet/big5.xml index 7cef7a64e..f1b8b72d8 100644 --- a/tests/illformed/chardet/big5.xml +++ b/tests/illformed/chardet/big5.xml @@ -1,8 +1,8 @@ �ڧƱ�??�ܮe��?��½?������A�}���U�_��??��C �P?�z??����C - \ No newline at end of file + diff --git a/tests/illformed/chardet/euckr.xml b/tests/illformed/chardet/euckr.xml index 767f3a59e..634dd8fd3 100644 --- a/tests/illformed/chardet/euckr.xml +++ b/tests/illformed/chardet/euckr.xml @@ -1,7 +1,7 @@ @@ -10,4 +10,4 @@ Expect: bozo and encoding == 'EUC-KR' TypeKey �ý����� UTF-8�� ���ư��µ�, �ű⼭ �ѱ۷� �� �г����� ���� ��쿡, EUC-KR�� �� ������Ÿ�� ���Ͽ��� �����̷�Ʈ�Ǿ� ���۵Ǿ���� �г����� UTF�� �翬�� ������ ��Ÿ����. ���� ���� ��� ����ϴ� �ʸ� ������ �г����� �ѱ۷� ����ϴ� ���� �е鵵 Ÿ��Ű������ �г����� �̷� ���������� �����ڸԱ�� ����� ���� �ִ�.... - \ No newline at end of file + diff --git a/tests/illformed/chardet/gb2312.xml b/tests/illformed/chardet/gb2312.xml index b28c10148..87a52c75e 100644 --- a/tests/illformed/chardet/gb2312.xml +++ b/tests/illformed/chardet/gb2312.xml @@ -1,7 +1,7 @@ diff --git a/tests/illformed/chardet/windows1255.xml b/tests/illformed/chardet/windows1255.xml index 0ab773f50..292c779a5 100644 --- a/tests/illformed/chardet/windows1255.xml +++ b/tests/illformed/chardet/windows1255.xml @@ -1,7 +1,7 @@