setup.py needs to open NEWS.rst in utf-8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GTimeLog |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Now that I'm building gtimelog for Debian using Python 3, setup.py needs to open NEWS.rst in utf-8, otherwise you get a UnicodeDecodeError:
Traceback (most recent call last):
File "setup.py", line 22, in <module>
changes = read('NEWS.
File "setup.py", line 11, in read
return f.read()
File "/usr/lib/
return codecs.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 5725: ordinal not in range(128)
It probably also makes sense to default the setup.py shebang to python3, although that doesn't affect Debian since I believe it invokes it explicitly with `python3 setup.py <command>`.
For gtimelog 0.9.1-1 in Debian, I'll quilt patch this for now. See attached.
This is only a problem when your locale is not UTF-8. I've added a setenv = LC_ALL=C to tox.ini so this'll be regression tested, and used io.open() so it'll continue to work on Python 2.