Created
February 26, 2016 18:57
-
-
Save clayg/e7fd810ed043319cbcae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nosetests swift/test/probe/test_object_expirer.py:TestObjectExpirer.test_expirer_object_split_brain -vsx | |
... | |
====================================================================== | |
ERROR: test_expirer_object_split_brain (test.probe.test_object_expirer.TestObjectExpirer) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/vagrant/swift/test/probe/test_object_expirer.py", line 62, in test_expirer_object_split_brain | |
self.brain.put_object(headers={'X-Delete-After': 2}) | |
File "/home/vagrant/swift/test/probe/brain.py", line 167, in put_object | |
self.object_name, headers=headers) | |
File "/vagrant/python-swiftclient/swiftclient/client.py", line 1271, in put_object | |
{'headers': headers}, resp, body) | |
File "/vagrant/python-swiftclient/swiftclient/client.py", line 153, in http_log | |
headers = scrub_headers(kwargs['headers']) | |
File "/vagrant/python-swiftclient/swiftclient/client.py", line 130, in scrub_headers | |
for (key, val) in headers | |
File "/vagrant/python-swiftclient/swiftclient/client.py", line 179, in parse_header_string | |
unquoted = unquote(data).decode('utf8') | |
File "/usr/lib/python2.7/urllib.py", line 1223, in unquote | |
bits = s.split('%') | |
AttributeError: 'int' object has no attribute 'split' | |
-------------------- >> begin captured logging << -------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/swiftclient/client.py b/swiftclient/client.py | |
index 8375fed..125dbeb 100644 | |
--- a/swiftclient/client.py | |
+++ b/swiftclient/client.py | |
@@ -169,6 +169,8 @@ def http_log(args, kwargs, resp, body): | |
def parse_header_string(data): | |
+ if not isinstance(data, six.text_type): | |
+ data = str(data) | |
if six.PY2: | |
if isinstance(data, six.text_type): | |
# Under Python2 requests only returns binary_type, but if we get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment