Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix-2.22.1'

  • Loading branch information...
commit 487ea4e04f35f6a1d7c7d3a1850466e3ed95a440 2 parents 06a3dae + 5415231
@toastdriven toastdriven authored
View
4 README.rst
@@ -1,9 +1,9 @@
####
boto
####
-boto 2.22.0
+boto 2.22.1
-Released: 2-January-2014
+Released: 6-January-2014
.. image:: https://travis-ci.org/boto/boto.png?branch=develop
:target: https://travis-ci.org/boto/boto
View
2  boto/__init__.py
@@ -37,7 +37,7 @@
import urlparse
from boto.exception import InvalidUriError
-__version__ = '2.22.0'
+__version__ = '2.22.1'
Version = __version__ # for backware compatibility
# http://bugs.python.org/issue7980
View
5 boto/auth.py
@@ -534,7 +534,10 @@ def canonical_uri(self, http_request):
# S3 does **NOT** do path normalization that SigV4 typically does.
# Urlencode the path, **NOT** ``auth_path`` (because vhosting).
path = urlparse.urlparse(http_request.path)
- encoded = urllib.quote(path.path)
+ # Because some quoting may have already been applied, let's back it out.
+ unquoted = urllib.unquote(path.path)
+ # Requote, this time addressing all characters.
+ encoded = urllib.quote(unquoted)
return encoded
def host_header(self, host, http_request):
View
3  boto/resultset.py
@@ -119,6 +119,9 @@ def endElement(self, name, value, connection):
self.next_token = value
elif name == 'nextToken':
self.next_token = value
+ # Code exists which expects nextToken to be available, so we
+ # set it here to remain backwards-compatibile.
+ self.nextToken = value
elif name == 'BoxUsage':
try:
connection.box_usage += float(value)
View
1  docs/source/index.rst
@@ -116,6 +116,7 @@ Release Notes
.. toctree::
:titlesonly:
+ releasenotes/v2.22.1
releasenotes/v2.22.0
releasenotes/v2.21.2
releasenotes/v2.21.1
View
22 docs/source/releasenotes/v2.22.1.rst
@@ -0,0 +1,22 @@
+boto v2.22.1
+============
+
+:date: 2014/01/06
+
+This release fixes working with keys with special characters in them while using
+Signature V4 with Amazon Simple Storage Service (S3). It also fixes a regression
+in the ``ResultSet`` object, re-adding the ``nextToken`` attribute. This was
+most visible from within Amazon Elastic Compute Cloud (EC2) when calling the
+``get_spot_price_history`` method.
+
+Users in the cn-north-1 region or who make active use of
+``get_spot_price_history`` are recommended to upgrade.
+
+
+Bugfixes
+--------
+
+* Fixed key names with special characters in S3 when using SigV4.
+ (:sha:`8b37180`)
+* Re-added the ``nextToken`` attribute to the EC2 result set object.
+ (:issue:`1968`, :sha:`6928928`)
View
19 tests/unit/auth/test_sigv4.py
@@ -346,6 +346,25 @@ def test_canonical_query_string(self):
qs = self.auth.canonical_query_string(self.awesome_bucket_request)
self.assertEqual(qs, 'max-keys=0')
+ def test_correct_handling_of_plus_sign(self):
+ request = HTTPRequest(
+ 'GET', 'https', 's3-us-west-2.amazonaws.com', 443,
+ 'hello+world.txt', None, {},
+ {}, ''
+ )
+ canonical_uri = self.auth.canonical_uri(request)
+ # Ensure that things are properly quoted.
+ self.assertEqual(canonical_uri, 'hello%2Bworld.txt')
+
+ request = HTTPRequest(
+ 'GET', 'https', 's3-us-west-2.amazonaws.com', 443,
+ 'hello%2Bworld.txt', None, {},
+ {}, ''
+ )
+ canonical_uri = self.auth.canonical_uri(request)
+ # Verify double escaping hasn't occurred.
+ self.assertEqual(canonical_uri, 'hello%2Bworld.txt')
+
def test_mangle_path_and_params(self):
request = HTTPRequest(
method='GET',
View
3  tests/unit/ec2/test_spotinstance.py
@@ -83,6 +83,8 @@ def test_get_spot_price_history(self):
self.assertEqual(len(response), 2)
self.assertEqual(response.next_token,
'q5GwEl5bMGjKq6YmhpDLJ7hEwyWU54jJC2GQ93n61vZV4s1+fzZ674xzvUlTihrl')
+ self.assertEqual(response.nextToken,
+ 'q5GwEl5bMGjKq6YmhpDLJ7hEwyWU54jJC2GQ93n61vZV4s1+fzZ674xzvUlTihrl')
self.assertEqual(response[0].instance_type, 'c3.large')
self.assertEqual(response[0].availability_zone, 'us-west-2c')
self.assertEqual(response[1].instance_type, 'c3.large')
@@ -106,4 +108,3 @@ def test_get_spot_price_history(self):
ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
'SignatureVersion', 'Timestamp',
'Version'])
-
Please sign in to comment.
Something went wrong with that request. Please try again.