summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paultax@gmail.com>2013-05-02 20:58:13 +0200
committerPaul <paultax@gmail.com>2013-05-02 20:58:13 +0200
commitf15376bb4cf91c8aee6a06fdc0d1e277969e8211 (patch)
tree2b14852213f30fc981eedfb789e9c56a6351e109
parented39394b8ff1e1a01170d6b1e0e3a1ea87a94c69 (diff)
downloadpython-requests-aws-f15376bb4cf91c8aee6a06fdc0d1e277969e8211.tar.gz
Fix issue#4 fix for encoded paths
Thanks @jamshid for reporting this Bumping to version 0.1.3
-rw-r--r--awsauth.py2
-rw-r--r--setup.py2
-rw-r--r--test.py14
3 files changed, 16 insertions, 2 deletions
diff --git a/awsauth.py b/awsauth.py
index 3d69bfc..e4d18d0 100644
--- a/awsauth.py
+++ b/awsauth.py
@@ -78,7 +78,7 @@ class S3Auth(AuthBase):
buf += '/%s' % bucket
# add the objectkey. even if it doesn't exist, add the slash
- buf += '/%s' % urllib.unquote(objectkey)
+ buf += '/%s' % objectkey
params_found = False
diff --git a/setup.py b/setup.py
index 7fb2461..e7d0d79 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ if sys.argv[-1] == 'publish':
setup(
name='requests-aws',
- version='0.1.2',
+ version='0.1.3',
author='Paul Tax',
author_email='paultax@gmail.com',
include_package_data=True,
diff --git a/test.py b/test.py
index e03dbc8..644b972 100644
--- a/test.py
+++ b/test.py
@@ -42,5 +42,19 @@ class TestAWS(unittest.TestCase):
r = requests.delete(url, auth=self.auth)
self.assertEqual(r.status_code, 204)
+ def test_put_get_delete_filname_encoded(self):
+ testdata = 'Sam is sweet'
+ filename = 'my%20file.txt'
+ url = 'http://'+ TEST_BUCKET + '.s3.amazonaws.com/%s'%(filename)
+ r = requests.put(url, data=testdata, auth=self.auth)
+ self.assertEqual(r.status_code, 200)
+ # Downloading a file
+ r = requests.get(url, auth=self.auth)
+ self.assertEqual(r.status_code, 200)
+ self.assertEqual(r.content, testdata)
+ # Removing a file
+ r = requests.delete(url, auth=self.auth)
+ self.assertEqual(r.status_code, 204)
+
if __name__ == '__main__':
unittest.main()