Skip to content

Fix setup.py install breaking due to unicode characters in README.md on Python 3 #1667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Feb 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

from setuptools import setup, find_packages
import glob
from io import open # for open(..,encoding=...) parameter in python 2
from os import walk
from os.path import join, dirname, sep
import os
import glob
import re
from setuptools import setup, find_packages

# NOTE: All package data should also be set in MANIFEST.in

Expand Down Expand Up @@ -52,13 +53,19 @@ def recursively_include(results, directory, patterns):
recursively_include(package_data, 'pythonforandroid',
['liblink', 'biglink', 'liblink.sh'])

with open(join(dirname(__file__), 'README.md')) as fileh:
with open(join(dirname(__file__), 'README.md'),
encoding="utf-8",
errors="replace",
) as fileh:
long_description = fileh.read()

init_filen = join(dirname(__file__), 'pythonforandroid', '__init__.py')
version = None
try:
with open(init_filen) as fileh:
with open(init_filen,
encoding="utf-8",
errors="replace"
) as fileh:
lines = fileh.readlines()
except IOError:
pass
Expand Down