Watchdog: Watchdog v0.10.0 fails to install (UnicodeDecodeError): v0.9.0 works fine

Created on 27 Jan 2020  Â·  7Comments  Â·  Source: gorakhargosh/watchdog

Collecting watchdog>=0.6.0
  Downloading watchdog-0.10.0.tar.gz (94 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xt0go193/watchdog/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xt0go193/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-xt0go193/watchdog/pip-egg-info
         cwd: /tmp/pip-install-xt0go193/watchdog/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xt0go193/watchdog/setup.py", line 86, in <module>
        changelog = f.read()
      File "/usr/lib/python3.6/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 63: ordinal not in range(128)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
bug

All 7 comments

From https://www.python.org/dev/peps/pep-0540/#locale-encoding-and-utf-8 :
"Python 3.6 uses the locale encoding... Many users inherit the ASCII encoding from the POSIX locale, aka the "C" locale"
I'd suggest trying:
LC_CTYPE=en_US.UTF-8 pip3.6 install watchdog

From https://www.python.org/dev/peps/pep-0540/#locale-encoding-and-utf-8 :
"Python 3.6 uses the locale encoding... Many users inherit the ASCII encoding from the POSIX locale, aka the "C" locale"
I'd suggest trying:
LC_CTYPE=en_US.UTF-8 pip3.6 install watchdog

I cannot thank you enough @tehkirill for the fix, we spent the morning trying to fix this and your fix works like a charm.

From https://www.python.org/dev/peps/pep-0540/#locale-encoding-and-utf-8 :
"Python 3.6 uses the locale encoding... Many users inherit the ASCII encoding from the POSIX locale, aka the "C" locale"
I'd suggest trying:
LC_CTYPE=en_US.UTF-8 pip3.6 install watchdog

Why is this needed in v0.10.0 where it wasn't needed before? Also, I'm installing about 100 other requirements without needing said workaround.

I cannot reproduce, even with LC_ALL=C python3 setup.py sdist. Do you have an idea how to reproduce?

Once I can reproduce, I will patch setup.py and @danilobellini will be able to do another release.

Why is this needed in v0.10.0 where it wasn't needed before? Also, I'm installing about 100 other requirements without needing said workaround.

There is a unicode character • in changelog.rst now

I cannot reproduce, even with LC_ALL=C python3 setup.py sdist. Do you have an idea how to reproduce?

Once I can reproduce, I will patch setup.py and @danilobellini will be able to do another release.

@BoboTiG is your python3 symlinked to python3.6 ? As it doesn't affect python3.7+ due to 'utf-8' enforcement.

In any case, specifying encoding with open('changelog.rst', encoding='utf-8') as f: in https://github.com/gorakhargosh/watchdog/blob/master/setup.py#L85
should fix it.

@tehkirill do you want to open a PR?

@BoboTiG opened #616

Was this page helpful?
0 / 5 - 0 ratings