#39 UnicodeDecodeError on sync --dry-run in 0.9.9.91

Malfunction
closed-fixed
nobody
s3cmd (119)
5
2015-02-09
2009-10-13
No

I'm just trying to use s3cmd (sync command) for the first time; is it is perfect for backing up my important s3 files elsewhere (I'm a little spooked after the Sidekick data loss fiasco). But, it is choking on a unicode character in one of my files.

Here is the output of "s3cmd sync --dry-run s3://<my bucket> .":

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the following lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Problem: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 35: ordinal not in range(128)
S3cmd: 0.9.9.91

Traceback (most recent call last):
File "/usr/local/bin/s3cmd", line 1736, in <module>
main()
File "/usr/local/bin/s3cmd", line 1681, in main
cmd_func(args)
File "/usr/local/bin/s3cmd", line 1070, in cmd_sync
return cmd_sync_remote2local(args)
File "/usr/local/bin/s3cmd", line 829, in cmd_sync_remote2local
output(u"download: %s -> %s" % (remote_list[key]['object_uri_str'], remote_list[key]['local_filename']))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 35: ordinal not in range(128)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the above lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I tried this on Mac OSX 10.5 with Python 2.5.1 and my Dreamhost shell account with Python 2.4.4 (this is where I really want to use it) with the same result.

The problem filename appears to be "fotos_cámara_026.jpg".

Any hope to fix this or a suggested patch?

Discussion

  • Ben Greenberg

    Ben Greenberg - 2009-10-14

    I poked into the code and looks like this is only a bug on --dry-run display. The sync itself seems to run fine. But I still want to a --dry-run before doing a sync. Patching the output to not crash on this character (maybe all unicode?) was very simple; patch attached.

     
  • Ben Greenberg

    Ben Greenberg - 2009-10-14

    Fix crash on output of unicode character in sync --dry-run.

     
    Attachments
  • Ben Greenberg

    Ben Greenberg - 2009-10-14
    • summary: UnicodeDecodeError in 0.9.9.91 --> UnicodeDecodeError on sync --dry-run in 0.9.9.91
     
  • Tomasz Chmielewski

    This is not just a big with --dry-run and still exists in s3cmd 1.5.0-beta1.

    Here is full diagnose:

    https://sourceforge.net/p/s3tools/discussion/618865/thread/c0ba30d9/

    Summary:

    This one works:

    s3cmd put "dsdöasd" s3://tomasz.test

    And this one doesn't:

    s3cmd put "dsdöasd" "s3://tomasz.test/dsdöasd"

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
    Please try reproducing the error using
    the latest s3cmd code from the git master
    branch found at:
    https://github.com/s3tools/s3cmd
    If the error persists, please report the
    following lines (removing any private
    info as necessary) to:
    s3tools-bugs@lists.sourceforge.net

    You have encountered a UnicodeEncodeError. Your environment
    variable LANG=en_US.UTF-8 may not specify a Unicode encoding (e.g. UTF-8).
    Please set LANG=en_US.UTF-8 or similar in your environment before
    invoking s3cmd.

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Traceback (most recent call last):
    File "/usr/bin/s3cmd", line 2463, in
    report_exception(e, msg)
    File "/usr/bin/s3cmd", line 2366, in report_exception
    sys.stderr.write("""Invoked as: %s""" % s)
    File "/usr/lib64/python2.6/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 34: ordinal not in range(128)

     
  • Matt Domsch

    Matt Domsch - 2015-02-09

    Many unicode fixes have been made in 1.5.x. Fixed in 1.5.2 certainly.

     
  • Matt Domsch

    Matt Domsch - 2015-02-09
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks