Anonymous - 2012-07-24

Hi,

Few days ago I ran into a problem using the put/get commands where the filename  (path)  of an object contained some accented unicode characters. This was on Linux platform.

I found and fix the problem as follow, hopefully others can test and confirm that it works for them as well.

Here is my unified diff for version 1.1.0-beta2
--- s3cmd 2012-07-23 14:19:58.726618474 +0000
+++ s3cmd 2012-07-23 14:18:05.000000000 +0000
@@ -252,7 +252,7 @@
destination_base_uri = S3Uri(args.pop())
if destination_base_uri.type != 's3':
raise ParameterError("Destination must be S3Uri. Got: %s" %
destination_base_uri)
- destination_base = str(destination_base_uri)
+ destination_base =
str(destination_base_uri.uri().encode(Config().encoding))
if len(args) == 0:
raise ParameterError("Nothing to upload. Expecting a local file or
directory.")
--- S3/FileLists.py 2012-07-23 14:22:03.594622900 +0000
+++ S3/FileLists.py 2012-07-23 14:14:20.000000000 +0000
@@ -229,7 +229,7 @@
remote_list[key] = objectlist[key]
else:
for uri in remote_uris:
- uri_str = str(uri)
+ uri_str = str(uri.uri().encode(cfg.encoding))
## Wildcards used in remote URI?
## If yes we'll need a bucket listing...
if uri_str.find('*') > -1 or uri_str.find('?') > -1:
[code]