-
Notifications
You must be signed in to change notification settings - Fork 204
Closed
Labels
Description
Package version: 4.1.dev0
Operating System: Windows 10 1909
Python version: Python 3.7.3 x64
Steps to reproduce
- Run
pip install neo4j-driver, or clone the repo and runpython setup.py install
Expected behavior
setup.py reads README.rst without encoding problems during installing the package.
Actual behavior
UnicodeDecodeError raised during installing the package.
C:\neo4j-python-driver>python setup.py install
Traceback (most recent call last):
File "setup.py", line 47, in <module>
readme = open(path_join(dirname(__file__), "README.rst")).read()
UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 1761: illegal multibyte sequence
The solution
Line 47 of setup.py
Original: readme = open(path_join(dirname(__file__), "README.rst")).read()
open function tried to use local encoding ('cp950' in my case) to open README.rst (which was encoded with 'utf-8').
Corrected: readme = open(path_join(dirname(__file__), "README.rst"), encoding='utf-8').read()
Specify 'utf-8' in open() fixed it.