From 56a06e5a9bbdc2a5ba6be2dab2e0e05767599e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 7 May 2015 17:44:30 +0200 Subject: Fix UnicodeEncodeError with non-ASCII paths, fixes #18 --- jsonpointer.py | 1 + tests.py | 1 + 2 files changed, 2 insertions(+) diff --git a/jsonpointer.py b/jsonpointer.py index 0f115d7..a465c69 100644 --- a/jsonpointer.py +++ b/jsonpointer.py @@ -49,6 +49,7 @@ __license__ = 'Modified BSD License' try: from urllib import unquote from itertools import izip + str = unicode except ImportError: # Python 3 from urllib.parse import unquote izip = zip diff --git a/tests.py b/tests.py index 44447da..e30f61e 100755 --- a/tests.py +++ b/tests.py @@ -61,6 +61,7 @@ class SpecificationTests(unittest.TestCase): "/k\"l", "/ ", "/m~0n", + u'/\xee', ] for path in paths: ptr = JsonPointer(path) -- cgit v1.2.1