Skip to content

Commit

Permalink
Pass utf-8 encoding when opening the README
Browse files Browse the repository at this point in the history
This was causing an error on my setup where LC_ALL wasn't set to UTF-8.

```
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/pz/w736zydx5pxdjbn0l0h_28_80000gr/T/pip-install-9c1pe10m/click-spinner/setup.py", line 6, in <module>
        readme = f.read()
      File "/Users/user/.pyenv/versions/3.5.5/Python.framework/Versions/3.5/lib/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 373: ordinal not in range(128)
```

Even though this usually happens on wrongly configured environments I think it makes sense to enforce it.
  • Loading branch information
bamarni authored Jun 1, 2018
1 parent 860be86 commit 55f4441
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from io import open
from setuptools import setup

import versioneer

with open('README.md') as f:
with open('README.md', encoding="utf8") as f:
readme = f.read()

setup(
Expand Down

0 comments on commit 55f4441

Please sign in to comment.