Skip to content

Commit cbc7e0a

Browse files
bollwyvlChangaco
andauthored
always read PKG-INFO and README as UTF-8 (#120)
Co-authored-by: Charly C <changaco@changaco.oy.lc>
1 parent 169fa1d commit cbc7e0a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
os.umask(0o022)
99

10+
with open(join(dirname(__file__), 'README.rst'), encoding="utf-8") as f:
11+
README = f.read()
12+
1013
setup(
1114
name='libarchive-c',
1215
version=get_version(),
@@ -16,7 +19,7 @@
1619
url='https://github.com/Changaco/python-libarchive-c',
1720
license='CC0',
1821
packages=find_packages(exclude=['tests']),
19-
long_description=open(join(dirname(__file__), 'README.rst')).read(),
22+
long_description=README,
2023
long_description_content_type='text/x-rst',
2124
keywords='archive libarchive 7z tar bz2 zip gz',
2225
)

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_version():
3535

3636
else:
3737
# Extract the version from the PKG-INFO file.
38-
with open(join(d, 'PKG-INFO')) as f:
38+
with open(join(d, 'PKG-INFO'), encoding='utf-8', errors='replace') as f:
3939
version = version_re.search(f.read()).group(1)
4040

4141
return version

0 commit comments

Comments
 (0)