infocusp / tf_cnnvis

CNN visualization tool in TensorFlow
MIT License
781 stars 209 forks source link

Quickfix for Python 3.x setup.py UnicodeDecodeError #18

Closed statikkkkk closed 6 years ago

statikkkkk commented 6 years ago

In setup.py, change function read() to the following:

def read(fname):
    if six.PY2:
        return open(os.path.join(os.path.dirname(__file__), fname)).read()
    else:
        return open(os.path.join(os.path.dirname(__file__), fname), encoding='latin1').read()

This will fix the issue if some users in Python 3.X encounter UnicodeDecodeError during the installation 👍

falaktheoptimist commented 6 years ago

Could you please provide some details on which platform you're seeing this error? And how does latin1 encoding help with resolving that error? Because the ReadMe file can be opened and read in python3 with the same open command.

statikkkkk commented 6 years ago

Yes - it's a Windows running Python 3.5.

Screenshot of running setup.py from master: screenshot_2

After encoding change, installation is successful. screenshot_1

falaktheoptimist commented 6 years ago

Alright, Thanks for the update. Would you like to send in a PR? Or we could make the change ourselves.