Standalone build failed MacOS python3 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3

Following the instructions at:

https://www.zotero.org/support/dev/client_coding/building_the_standalone_client

Running "scripts/dir_build" in "zotero-standalone-build" fails with:

Traceback (most recent call last):
File "........./zotero-build/xpi/build_xpi", line 162, in main
contents = f.read()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/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 0xc3 in position 3362: ordinal not in range(128)
  • How did you install Python into /opt? It looks like your Python installation isn't set to use UTF-8 by default. It works for me with Python 3.6.4 from Homebrew.

    You can run `import locale` and `locale.getpreferredencoding()` from python3 to see the default encoding (which appears to be 'ascii' in your case instead of 'UTF-8'). `echo $LANG` from the command line (which returns 'en_US.UTF-8' for me) may also be instructive.

    In any case, I've updated that build script to use UTF-8 explicitly when reading translator files, so you can pull again and try that (though it's possible there will be additional issues).

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.