From cb32aadc0881da5f0335c179aab3733bd93cbb4e Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 25 Apr 2014 16:52:16 -0700 Subject: [PATCH] client: fix unicode handling Use unicode format strings, and don't url-encode the object copy path before passing it to requests, which will url-encode it for us. Partially-fixes: #8202 Signed-off-by: Josh Durgin --- radosgw_agent/client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/radosgw_agent/client.py b/radosgw_agent/client.py index 2b8f027..bd39d5b 100644 --- a/radosgw_agent/client.py +++ b/radosgw_agent/client.py @@ -182,7 +182,7 @@ def get_op_state(connection, client_id, op_id, bucket, obj): return request(connection, 'get', 'admin/opstate', params={ 'op-id': op_id, - 'object': '{0}/{1}'.format(bucket, obj), + 'object': u'{0}/{1}'.format(bucket, obj), 'client-id': client_id, } ) @@ -191,7 +191,7 @@ def remove_op_state(connection, client_id, op_id, bucket, obj): return request(connection, 'delete', 'admin/opstate', params={ 'op-id': op_id, - 'object': '{0}/{1}'.format(bucket, obj), + 'object': u'{0}/{1}'.format(bucket, obj), 'client-id': client_id, }, expect_json=False, @@ -213,9 +213,9 @@ def delete_object(connection, bucket_name, object_name): def sync_object_intra_region(connection, bucket_name, object_name, src_zone, client_id, op_id): - path = '{bucket}/{object}'.format( - bucket=url_safe(bucket_name), - object=url_safe(object_name), + path = u'{bucket}/{object}'.format( + bucket=bucket_name, + object=object_name, ) return request(connection, 'put', path, params={ -- 2.47.3