Can't convert 'bytes' object to str implicitly on HTTP error

Bug #1457012 reported by Szépe Viktor
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Charles Hsu

Bug Description

`swift -q upload --object-name workwear/workwear-00000.zpaq db-ftp workwear-00000.zpaq > /dev/null`
returned exit code zero and this traceback:

Traceback (most recent call last):
  File "/usr/local/bin/swift", line 11, in <module>
    sys.exit(main())
  File "/opt/python-3.4.3/lib/python3.4/site-packages/swiftclient/shell.py", line 1309, in main
    globals()['st_%s' % args[0]](parser, argv[1:], output)
  File "/opt/python-3.4.3/lib/python3.4/site-packages/swiftclient/shell.py", line 838, in st_upload
    msg += error.http_response_content[:60]
TypeError: Can't convert 'bytes' object to str implicitly

python-3.4.3
python-swiftclient==2.4.0

Revision history for this message
Szépe Viktor (szepe.viktor) wrote :

Could it be a binary HTTP response?

Revision history for this message
Charles Hsu (charles0126) wrote :

I think the response is a byte string. likes below.

b'<html><h1>Forbidden</h1><p>Access was denied to this resourc'

Changed in python-swiftclient:
status: New → Confirmed
assignee: nobody → Charles Hsu (charles0126)
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/213640

Changed in python-swiftclient:
status: Confirmed → In Progress
Revision history for this message
Szépe Viktor (szepe.viktor) wrote :

Thank you!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

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

commit ee8c1bab9873c0bf87a12ebebc4a12c233586687
Author: Charles Hsu <email address hidden>
Date: Mon Aug 17 17:06:44 2015 +0800

    Convert http response(byte string) to string in python3.

    Avoid a TypeError exception in python3.

    Change-Id: I4039e3f2a88b5f681288b5ca8dd5c63c13b7764f
    Closes-bug: #1457012

Changed in python-swiftclient:
status: In Progress → Fix Released
Revision history for this message
Nicolas (nicolascotsis) wrote :

Hi,
I have the same error since yesterday and I've not changed anything.
Could you help me please ?
Thank you !

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-swiftclient 3.0.0

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.