diff options
author | John Dickinson <me@not.mn> | 2014-03-30 10:08:09 -0700 |
---|---|---|
committer | John Dickinson <me@not.mn> | 2014-03-30 10:29:36 -0700 |
commit | 1f0dd002db577cf3819abac762939ce0e678c93b (patch) | |
tree | 831c01c3e39ddb1c91d2b9f8b88d35b6c2c09824 /swiftclient/client.py | |
parent | 4f3d6e7f3af0c518d7a55b930947a6fbd5b0a5ae (diff) | |
download | python-swiftclient-1f0dd002db577cf3819abac762939ce0e678c93b.tar.gz |
don't use mutable defaults in kwargs
Change-Id: I3ae71259ccc49a5d8a852388784c3dfd577df50a
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r-- | swiftclient/client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index c5b9a24..11f2845 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -187,8 +187,10 @@ class HTTPConnection: """ Final wrapper before requests call, to be patched in tests """ return requests.request(*arg, **kwarg) - def request(self, method, full_path, data=None, headers={}, files=None): + def request(self, method, full_path, data=None, headers=None, files=None): """ Encode url and header, then call requests.request """ + if headers is None: + headers = {} headers = dict((encode_utf8(x.lower()), encode_utf8(y)) for x, y in headers.items()) # set a default User-Agent header if it wasn't passed in @@ -202,7 +204,7 @@ class HTTPConnection: files=files, **self.requests_args) return self.resp - def putrequest(self, full_path, data=None, headers={}, files=None): + def putrequest(self, full_path, data=None, headers=None, files=None): """ Use python-requests files upload |