fedora-python / python-ethtool

Deprecated Python bindings for the ethtool kernel interface
GNU General Public License v2.0
15 stars 13 forks source link

UnicodeDecodeError on build #46

Closed The-Judge closed 6 years ago

The-Judge commented 6 years ago

During build on Python 3.6.5 (pip3 install ethtool==0.13), I receive the following error:

  Downloading https://files.pythonhosted.org/packages/5e/b5/8af4daccd6ac8f548d8a1c96d5697fc0d424e47c7f5c76183107b8af6bd0/ethtool-0.13.tar.gz (44kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-5lwqn5lb/ethtool/setup.py", line 94, in <module>
        long_description = f.read()
      File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 1829: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5lwqn5lb/ethtool/

I have no idea what is wrong; ethtool module builds on other hosts. Is this a known issue with environment or something maybe?

hroncok commented 6 years ago

I cannot reproduce this. What's you operating system?

hroncok commented 6 years ago

What is the output of locale shell command?

hroncok commented 6 years ago

I can reproduce this with Python 3.5 and ASCII locale.

Collecting ethtool
  Using cached https://files.pythonhosted.org/packages/5e/b5/8af4daccd6ac8f548d8a1c96d5697fc0d424e47c7f5c76183107b8af6bd0/ethtool-0.13.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-avo1f256/ethtool/setup.py", line 94, in <module>
        long_description = f.read()
      File "/usr/lib64/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 1829: ordinal not in range(128)
The-Judge commented 6 years ago

Thank you for your incredibly fast reply! I'm on CentOS 6.7 with Python 3.6.5 installed from iUS (package python36u-3.6.5-1.ius.centos6.x86_64).

Output of locale is:

LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

PS: Thanks for also comming up with a workarround: Setting the LC_* to an utf8 enabled one makes it work like a charm:

export LC_ALL='en_US.UTF-8' && pip3 install ethtool==0.13
...
Successfully built ethtool
Installing collected packages: ethtool
Successfully installed ethtool-0.13