You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2018/08/29 18:56:22 UTC
libcloud git commit: Adapt to new Python 3.7 urlquote behavior
Repository: libcloud
Updated Branches:
refs/heads/trunk c3198a093 -> e0a46319d
Adapt to new Python 3.7 urlquote behavior
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e0a46319
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e0a46319
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e0a46319
Branch: refs/heads/trunk
Commit: e0a46319d878fe1abc66b98a3b93d439fcd0a4ad
Parents: c3198a0
Author: Quentin Pradet <qu...@apache.org>
Authored: Wed Aug 29 22:47:40 2018 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Wed Aug 29 22:47:40 2018 +0400
----------------------------------------------------------------------
libcloud/test/__init__.py | 7 ++++++-
libcloud/test/test_utils.py | 8 ++++----
2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e0a46319/libcloud/test/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py
index 149de42..091813b 100644
--- a/libcloud/test/__init__.py
+++ b/libcloud/test/__init__.py
@@ -173,7 +173,12 @@ class MockHttp(LibcloudConnection):
def _get_method_name(self, type, use_param, qs, path):
path = path.split('?')[0]
- meth_name = path.replace('/', '_').replace('.', '_').replace('-', '_')
+ meth_name = (
+ path
+ .replace('/', '_')
+ .replace('.', '_')
+ .replace('-', '_')
+ .replace('~', '%7E')) # Python 3.7 no longer quotes ~
if type:
meth_name = '%s_%s' % (meth_name, self.type)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e0a46319/libcloud/test/test_utils.py
----------------------------------------------------------------------
diff --git a/libcloud/test/test_utils.py b/libcloud/test/test_utils.py
index 5f866fd..3019060 100644
--- a/libcloud/test/test_utils.py
+++ b/libcloud/test/test_utils.py
@@ -258,12 +258,12 @@ class TestUtils(unittest.TestCase):
self.assertEqual(b(uri), b('%C3%A9'))
# Unicode without unicode characters
- uri = urlquote('~abc')
- self.assertEqual(b(uri), b('%7Eabc'))
+ uri = urlquote('v=1')
+ self.assertEqual(b(uri), b('v%3D1'))
# Already-encoded bytestring without unicode characters
- uri = urlquote(b('~abc'))
- self.assertEqual(b(uri), b('%7Eabc'))
+ uri = urlquote(b('v=1'))
+ self.assertEqual(b(uri), b('v%3D1'))
def test_get_secure_random_string(self):
for i in range(1, 500):