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

Build fail with UnicodeDecodeError: ordinal not in range(128) in extras/build_mo.py <del>when source dir is under CJK path</del> #551

Closed
Vdragon opened this Issue Feb 5, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@Vdragon
Contributor

Vdragon commented Feb 5, 2016

Encountered this issue when testing PR #549

Steps to Reproduce Issue

  1. Create folder named "中文路徑"
  2. Copy source folder under "中文路徑" folder
  3. Run make under the new source folder

UPDATE: It seems that the issue can be reproduced even on encoding-safe path, like /tmp/gitcola

Build Log

python setup.py build
running build
running build_mo
Traceback (most recent call last):
  File "setup.py", line 78, in <module>
    main()
  File "setup.py", line 44, in main
    data_files = cola_data_files())
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/tmp/中文路徑/gitcola/extras/build_mo.py", line 66, in run
    if find_executable('msgfmt') is None:
  File "/usr/lib/python2.7/distutils/spawn.py", line 220, in find_executable
    f = os.path.join(p, executable)
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 14: ordinal not in range(128)
Makefile:77: recipe for target 'build' failed
make: *** [build] Error 1

Reporter's Environment

Operating System

Ubuntu 15.10 AMD64

Locale

LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_HK:zh_CN:en_US:en
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC=zh_TW.UTF-8
LC_TIME=zh_TW.UTF-8
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY=zh_TW.UTF-8
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER=zh_TW.UTF-8
LC_NAME=zh_TW.UTF-8
LC_ADDRESS=zh_TW.UTF-8
LC_TELEPHONE=zh_TW.UTF-8
LC_MEASUREMENT=zh_TW.UTF-8
LC_IDENTIFICATION=zh_TW.UTF-8
LC_ALL=

Git Cola

commit 3a5c09f

@Vdragon Vdragon changed the title from Build fail with UnicodeDecodeError: ordinal not in range(128) in extras/build_mo.py when source dir is under CJK path to Build fail with UnicodeDecodeError: ordinal not in range(128) in extras/build_mo.py <del>when source dir is under CJK path</del> Feb 5, 2016

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Feb 5, 2016

Member

I have a fix. Thanks for testing the other MR. I'll merge that one now and I'll have a fix for this shortly

Member

davvid commented Feb 5, 2016

I have a fix. Thanks for testing the other MR. I'll merge that one now and I'll have a fix for this shortly

davvid added a commit that referenced this issue Feb 5, 2016

setup.py: allow installing from and to utf-8 encoded paths
Python's stdlib is buggy as all hell and it does not properly handle
unicode.  The *only* crazy thing that does work is to force the encoding
to utf-8 on python2 to fix their broken code.

Allow installing to/from utf-8 encoded paths by making python2 have the
same utf-8 default as python3.

Related-to: #551
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in 5f0097b Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment