-
-
Notifications
You must be signed in to change notification settings - Fork 908
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
UnicodeDecodeError #847
Comments
the detail error log. |
The next output line should be a policy. By chance does your policy have
unicode characters in it? That's where it's failing.
…On Wed, Mar 22, 2017 at 4:30 AM, baiyanchun ***@***.***> wrote:
the detail error log.
s3cmd.txt <https://github.com/s3tools/s3cmd/files/860924/s3cmd.txt>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#847 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAqDqhkBz84sgwk_4UA62Ml3OeqjxtDyks5roOolgaJpZM4Mk7PB>
.
|
@baiyanchun Any feedback regarding the idea of mdomsch? |
@baiyanchun Is it possible for your to confirm that the issue come from having chinese characters somewhere in your policy? and if you paste us an extract here? so I can reproduce and fix? |
I get this issue when trying to transfer file with accents in the filename (i.e. Capture_d’écran_2015-10-23_à_09.20.45.png) |
Commenting out the console output fixes the issue: Line 1103 in 65b34b7
Looks like an issue with python incorrectly detecting the filename encoding or something. |
@jdurand : Can you tell me what is the version of Python and s3cmd that you are using? Also the command that you are running (hiding private parts of paths). Also in your configuration you can check if you have any 'encoding' set. Because what surprise me is that normally in this part of the code, path are already converted to Unicode to not cause such an issue. |
Python 2.7.15 I'm not familiar with Python, what command should I run or which config file should I check? |
What is the "s3cmd" command line with arguments that you run for your transfer that is failing? |
I was running |
Would it still be possible for you to run that command with the -d and look what is the root cause of the failure? |
|
This patch allows cmd_info to work properly in case of getting any unicode chars in reply to bucket Policy/CORS requests. Fixes at least s3tools#847
I've submitted a patch which should fix this. |
The issue is somehow still around...
|
I think that @offshore fixed the original poster error, |
I used s3cmd command (the latest s3cmd code I use) to put a file named in Chinese, when I use s3cmd info bucket, An unexpected error has occurred. The following is my operation process and result.
1 Create a bucket
s3cmd mb s3://bucket
Bucket 's3://bucket/' created
2 Create a file named in Chinese
touch 中文.txt
3 Put file to s3://bucket
s3cmd put 中文.txt s3://bucket
upload: '中文.txt' -> 's3://bucket/中文.txt' [1 of 1]
0 of 0 0% in 0s 0.00 B/s done
4 Ls this file
s3cmd ls s3://bucket
2017-03-21 02:55 0 s3://bucket/中文.txt
5 Get bucket info
s3cmd info s3://bucket
The error message:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Invoked as: /usr/local/bin/s3cmd info s3://bucket
Problem: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 496: ordinal not in range(128)
S3cmd: 1.6.1
python: 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4]
environment LANG=en_US.UTF-8
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/s3cmd-1.6.1-py2.7.egg/EGG-INFO/scripts/s3cmd", line 2996, in
File "/usr/local/lib/python2.7/dist-packages/s3cmd-1.6.1-py2.7.egg/EGG-INFO/scripts/s3cmd", line 2915, in main
File "/usr/local/lib/python2.7/dist-packages/s3cmd-1.6.1-py2.7.egg/EGG-INFO/scripts/s3cmd", line 918, in cmd_info
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 496: ordinal not in range(128)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The text was updated successfully, but these errors were encountered: