Skip to content

Conversation

@ktns
Copy link

@ktns ktns commented Feb 5, 2020

Fixes #84.

It seems setuptools can determine an encoding of a file if I write like long_description = file: README.rst in setup.cfg.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 95.861% when pulling 31b27fe on ktns:use-setup.cfg-for-long_description into 749d69f on AdvancedClimateSystems:master.

@OrangeTux OrangeTux self-requested a review February 5, 2020 10:07

cwd = os.path.dirname(os.path.abspath(__name__))

long_description = open(os.path.join(cwd, 'README.rst'), 'r').read()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering, is the problem also fixed if you open the file using utf-8 encoding? like

 long_description = open(os.path.join(cwd, 'README.rst'), 'r', encoding='utf-8').read() 

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure you are willing to keep compatibility with python2, so I suggested the way using setup.cfg that will also work with python2. If you are not willing, of course the way using encoding='utf-8' is also possible.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you thought about backward compatibility. But we just decided to drop Python 2 support, see #86 . So we can use the encoding argument of open().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError from setup.py with python3.6 and LANG=C

3 participants