diff --git a/moto/s3bucket_path/urls.py b/moto/s3bucket_path/urls.py index 28f1debc8..3d9d09cea 100644 --- a/moto/s3bucket_path/urls.py +++ b/moto/s3bucket_path/urls.py @@ -16,5 +16,5 @@ url_paths = { '{0}/$': bucket_response3, '{0}/(?P[a-zA-Z0-9\-_.]+)$': ro.bucket_response, '{0}/(?P[a-zA-Z0-9\-_.]+)/$': bucket_response2, - '{0}/(?P[a-zA-Z0-9\-_./]+)/(?P[a-zA-Z0-9\-_.?]+)': ro.key_response + '{0}/(?P[a-zA-Z0-9\-_./]+)/(?P.+)': ro.key_response } diff --git a/tests/test_s3bucket_path/test_s3bucket_path.py b/tests/test_s3bucket_path/test_s3bucket_path.py index 1f62f23eb..5501aea3f 100644 --- a/tests/test_s3bucket_path/test_s3bucket_path.py +++ b/tests/test_s3bucket_path/test_s3bucket_path.py @@ -231,12 +231,12 @@ def test_key_with_special_characters(): conn = create_connection() bucket = conn.create_bucket('test_bucket_name') - key = Key(bucket, 'test_list_keys_2/x?y') + key = Key(bucket, 'test_list_keys_2/*x+?^@~!y') key.set_contents_from_string('value1') key_list = bucket.list('test_list_keys_2/', '/') keys = [x for x in key_list] - keys[0].name.should.equal("test_list_keys_2/x?y") + keys[0].name.should.equal("test_list_keys_2/*x+?^@~!y") @mock_s3bucket_path