question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot mv non-ascii path

See original GitHub issue
(pyenv)[gcp@instance ~]$ gsutil mv 'gs://foo-videos/最孤單的人 - 廖文強與壞神經樂團 (Official Music Video).mp4' gs://foo-videos/mv.mp4
Failure: 'ascii' codec can't encode characters in position 16-20: ordinal not in range(128).

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eyalfinkcommented, Nov 23, 2015

I’m still seeing this problem which using gsutil cp: I’m feeding gsutil with it’s own output with -I

gsutil ls gs://non-ascii-bug|gsutil cp -I gs://ywz-tmp

I’m getting

ValidationError: Field object encountered non-ASCII string 'File 3D_09 - MANOPOLE_09_06.1-PVZ_7317125_PVZ33x123_\xd0\xab20.stl': 'ascii' codec can't decode byte 0xd0 in position 52: ordinal not in range(128)

(you can try the above your self) I’m using gsutil version 4.15 and did

export LC_ALL=en_US.UTF-8

I see this bug is still open - is it suppose to be fixed?

0reactions
paskalcommented, Aug 10, 2015

Thanks a lot for help, it’s turned out to be unset locale settings:

root@my_server:~# env|grep -E '(LC|LANG)'
LC_ALL=C
LANG=C
LANGUAGE=C
root@my_server:~# /usr/bin/gsutil -m rsync -r /hosted/aaa/images/ gs://bucket_name/hosted/aaa/images/
Building synchronization state...
Caught non-retryable exception while listing file:///hosted/aaa/images/: 'ascii' codec can't encode character u'\xfc' in position 56: ordinal not in range(128)
CommandException: Caught non-retryable exception - aborting rsync
Caught ^C - exiting
root@my_server:~# export LC_ALL=en_US.UTF-8
root@my_server:~# /usr/bin/gsutil -m rsync -r /hosted/aaa/images/ gs://bucket_name/hosted/aaa/images/
Building synchronization state...
Starting synchronization
Copying file:///hosted/aaa/images/athens/file_to_sync.jpg [Content-Type=image/jpeg]...

So, if you’re getting codec can't encode character * in position *: ordinal not in range (128), check your locale settings, and if they’re not set, add export LC_ALL=en_US.UTF-8 to your .bashrc file. Another way to do that inside python:

from os import environ
from subprocess import check_call
command = 'gsutil -m rsync {parameters} {folder} {bucket}{folder}'
check_call(command.split(' '), env=dict(environ, LC_ALL="en_US.UTF-8"))

Feel free to close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Your project path contains non-ASCII characters android studio
The best solution to your problem is to move your project folder to other directory with no non-ASCII characters and ...
Read more >
cant rename/move files with non ascii characters in their names.
Check that the files are actually there. Navigate to the NAS share and change the names there. Old habit... I don't like non...
Read more >
Error: project path contains #non-ASCII characters | Fixing
StopExecutionException: Your project path contains non-ASCII characters. ... Please move your project to a different directory.
Read more >
Problems Migrating Cubes with non-ASCII Characters on UNIX
... 7 PowerPlay Enterprise Server service is using a non-ASCII path name to ... the IBM Cognos BI server is unable to locate...
Read more >
Error when builden apk - Unity Forum
Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found