Error with uploading large object includes unicode path

Bug #1532096 reported by Ryota Kawamitsu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Jude Augustine Job

Bug Description

I have the following issue when I try to upload a big file includes unicode path with python-swiftclient==2.7.0.

$ swift --debug --info upload -S 200M test テスト/dummy.dat
<..omit..>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/swiftclient/service.py", line 1911, in _upload_object_job
    quote(seg_container), quote(obj),
  File "/usr/lib64/python2.6/urllib.py", line 1236, in quote
    res = map(safe_map.__getitem__, s)
KeyError: u'\u30c6'
u'\u30c6'
テスト/dummy.dat segment 2
テスト/dummy.dat segment 1
テスト/dummy.dat segment 0

I think the cause of this problem is the following code.

in 'python-swiftclient/swiftclient/service.py', line 1911

        else:
           new_object_manifest = '%s/%s/%s/%s/%s/' % (
               quote(seg_container), quote(obj),

It should be such as the following code.

        else:
           new_object_manifest = '%s/%s/%s/%s/%s/' % (
               quote(seg_container.encode('utf8')), quote(obj.encode('utf8')),

I have succeeded when I try to upload with the above edited code.

$ swift --debug --info upload -S 200M test テスト/dummy.dat
<..omit..>
テスト/dummy.dat segment 2
テスト/dummy.dat segment 0
テスト/dummy.dat segment 1
テスト/dummy.dat

My Enviroment:

$ cat /etc/redhat-release
CentOS release 6.7 (Final)
$ echo $LANG
ja_JP.UTF-8
$ python --version
Python 2.6.6
$ swift --version
python-swiftclient 2.7.0

Changed in python-swiftclient:
assignee: nobody → Jude Augustine Job (judeaugustine-j)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/265544

Changed in python-swiftclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/265544
Committed: https://git.openstack.org/cgit/openstack/python-swiftclient/commit/?id=47f673ed9f8652a3e19ec12a03196e2fa79ef92a
Submitter: Jenkins
Branch: master

commit 47f673ed9f8652a3e19ec12a03196e2fa79ef92a
Author: Jude Job <email address hidden>
Date: Sat Jan 9 18:49:17 2016 +0530

    Error with uploading large object includes unicode path

    This patch include a test case to test unicode path.

    Change-Id: I7697679f0034ce65b068791d7d5145286d992bd1
    Closes-Bug: #1532096

Changed in python-swiftclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-swiftclient 3.0.0

This issue was fixed in the openstack/python-swiftclient 3.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/python-swiftclient 3.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.