"swift stat container åbject" fails when object exists and has non-ascii in name

Bug #1426087 reported by Tuomas Heino on 2015-02-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Undecided
Unassigned
python-swiftclient (Ubuntu)
Low
Unassigned

Bug Description

$ swift stat -- container 'åbject'
Traceback (most recent call last):
  File "/usr/bin/swift", line 1479, in <module>
    globals()['st_%s' % args[0]](parser, argv[1:], thread_manager)
  File "/usr/bin/swift", line 671, in st_stat
    command_helpers.stat_object(conn, options, args, thread_manager)
  File "/usr/lib/python2.7/dist-packages/swiftclient/command_helpers.py", line 98, in stat_object
    ), skip_missing=True)
  File "/usr/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 235, in print_items
    self.print_msg('\n'.join(lines))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 58: ordinal not in range(128)

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_IE.UTF-8
LC_TIME=en_IE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_IE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_IE.UTF-8
LC_NAME=en_IE.UTF-8
LC_ADDRESS=en_IE.UTF-8
LC_TELEPHONE=en_IE.UTF-8
LC_MEASUREMENT=en_IE.UTF-8
LC_IDENTIFICATION=en_IE.UTF-8
LC_ALL=

Partial(*) temp fix (real fix is python3):
--- /usr/lib/python2.7/dist-packages/swiftclient/command_helpers.py.orig 2014-03-02 19:59:57.000000000 +0200
+++ /usr/lib/python2.7/dist-packages/swiftclient/command_helpers.py 2015-02-26 21:05:33.879047630 +0200
@@ -89,7 +89,7 @@
     thread_manager.print_items((
         ('Account', conn.url.rsplit('/', 1)[-1]),
         ('Container', args[0]),
- ('Object', args[1]),
+ ('Object', unicode(args[1], 'utf8')),
         ('Content Type', headers.get('content-type')),
         ('Content Length', content_length),
         ('Last Modified', headers.get('last-modified')),

*: Most likely similar issue exists for container names as well.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-swiftclient 1:2.0.3-0ubuntu1 [modified: usr/lib/python2.7/dist-packages/swiftclient/command_helpers.py]
ProcVersionSignature: Ubuntu 3.13.0-45.74-generic 3.13.11-ckt13
Uname: Linux 3.13.0-45-generic i686
ApportVersion: 2.14.1-0ubuntu3.7
Architecture: i386
Date: Thu Feb 26 21:07:52 2015
InstallationDate: Installed on 2010-12-23 (1525 days ago)
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
PackageArchitecture: all
SourcePackage: python-swiftclient
UpgradeStatus: Upgraded to trusty on 2015-02-19 (7 days ago)

Tuomas Heino (iheino+ub) wrote :
Chuck Short (zulcss) on 2017-04-10
Changed in python-swiftclient (Ubuntu):
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers