[Bug 1426087] [NEW] "swift stat container åbject" fails when object exists and has non-ascii in name

Tuomas Heino iheino+ub at cc.hut.fi
Thu Feb 26 19:14:40 UTC 2015


Public bug reported:

$ 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)

** Affects: python-swiftclient (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug i386 trusty

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to python-swiftclient in Ubuntu.
https://bugs.launchpad.net/bugs/1426087

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-swiftclient/+bug/1426087/+subscriptions



More information about the Ubuntu-server-bugs mailing list