Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jgb opened this issue Jan 27, 2020 · 7 comments · Fixed by #616
Closed

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

jgb opened this issue Jan 27, 2020 · 7 comments · Fixed by #616
Labels
Milestone

Comments

@jgb
Copy link

jgb commented Jan 27, 2020

Collecting watchdog>=0.6.0
  Downloading watchdog-0.10.0.tar.gz (94 kB)
�[91m    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)
    ----------------------------------------
�[0m�[91mERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@tehkirill
Copy link
Contributor

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

@antoinejaussoin
Copy link

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.

@jgb
Copy link
Author

jgb commented Jan 27, 2020

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.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Jan 27, 2020

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.

@tehkirill
Copy link
Contributor

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.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Jan 27, 2020

@tehkirill do you want to open a PR?

tehkirill added a commit to tehkirill/watchdog that referenced this issue Jan 27, 2020
@tehkirill
Copy link
Contributor

@BoboTiG opened #616

BoboTiG pushed a commit that referenced this issue Jan 27, 2020
* enforce 'utf-8' encoding, fixes #615

* using `open` from `codecs` for py2.7 support

* Updated changelog to reflect OS locale fix
@BoboTiG BoboTiG added this to the 0.10.1 milestone Jan 30, 2020
@BoboTiG BoboTiG added the bug label Jan 30, 2020
CCP-Aporia pushed a commit to CCP-Aporia/watchdog that referenced this issue Aug 13, 2020
…hargosh#616)

* enforce 'utf-8' encoding, fixes gorakhargosh#615

* using `open` from `codecs` for py2.7 support

* Updated changelog to reflect OS locale fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants