Replace python3-chardet with python3-charset-normalizer

This is the last consumer of chardet in the ELN package set.  Other
consumers having already switched to charset-normalizer, which provides
a compatible "detect" method for easy porting.
This commit is contained in:
Yaakov Selkowitz 2023-06-06 07:41:47 -04:00
parent 5196f851c7
commit b7799d8e8a
2 changed files with 7 additions and 4 deletions

View File

@ -256,10 +256,10 @@ def parse_options():
return args return args
def check_encoding(filename): def check_encoding(filename):
import chardet import charset_normalizer
with open(filename, 'rb') as f: with open(filename, 'rb') as f:
charenc = chardet.detect(f.read())['encoding'] charenc = charset_normalizer.detect(f.read())['encoding']
if debug & 1: if debug & 1:
print("File encoding: {}".format(charenc)) print("File encoding: {}".format(charenc))

View File

@ -20,7 +20,7 @@
Name: gutenprint Name: gutenprint
Summary: Printer Drivers Package Summary: Printer Drivers Package
Version: 5.3.4 Version: 5.3.4
Release: 10%{?dist} Release: 11%{?dist}
URL: http://gimp-print.sourceforge.net/ URL: http://gimp-print.sourceforge.net/
Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.xz Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.xz
# Post-install script to update CUPS native PPDs. # Post-install script to update CUPS native PPDs.
@ -154,7 +154,7 @@ Requires: cups
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
# for cups-genppdupdate python script # for cups-genppdupdate python script
Requires: python3 Requires: python3
Requires: python3-chardet Requires: python3-charset-normalizer
%description cups %description cups
This package contains native CUPS support for a wide range of Canon, This package contains native CUPS support for a wide range of Canon,
@ -314,6 +314,9 @@ exit 0
%{_mandir}/man8/cups-genppd*8*.gz %{_mandir}/man8/cups-genppd*8*.gz
%changelog %changelog
* Tue Jun 06 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 5.3.4-11
- Replace python3-chardet with python3-charset-normalizer
* Wed Apr 05 2023 Zdenek Dohnal <zdohnal@redhat.com> - 5.3.4-11 * Wed Apr 05 2023 Zdenek Dohnal <zdohnal@redhat.com> - 5.3.4-11
- GTK2 is not in CentOS Stream 10, dont ship libs-ui subpackage there - GTK2 is not in CentOS Stream 10, dont ship libs-ui subpackage there
- Add other licenses to License tag and use SPDX identifiers to comply with FPG - Add other licenses to License tag and use SPDX identifiers to comply with FPG