It looks like jsonpointer will not work with unicode keys, both of the following code snippets fail:
data = {u'\xee': u'\xee'}
jsonpatch.make_patch({}, data)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 171, in make_patch
return JsonPatch.from_diff(src, dst)
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 322, in from_diff
return cls(list(compare_values([], src, dst)))
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 293, in compare_values
for operation in compare_dicts(path, value, other):
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 314, in compare_dicts
ptr = JsonPointer.from_parts(path + [key])
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpointer.py", line 291, in from_parts
parts = [str(part) for part in parts]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xee' in position 0: ordinal not in range(128)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 171, in make_patch
return JsonPatch.from_diff(src, dst)
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 322, in from_diff
return cls(list(compare_values([], src, dst)))
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 293, in compare_values
for operation in compare_dicts(path, value, other):
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpatch.py", line 314, in compare_dicts
ptr = JsonPointer.from_parts(path + [key])
File "/opt/sendhub/scratch/contacts_v2_scratch/venv/local/lib/python2.7/site-packages/jsonpointer.py", line 292, in from_parts
parts = [part.replace('~', '~0') for part in parts]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
It looks like jsonpointer will not work with unicode keys, both of the following code snippets fail: