JsonPatch currently allows JSON Patch operations to resolve pointer segments like /0 against JSON strings, effectively indexing into strings and producing characters. This is not compliant with JSON Pointer (RFC 6901) evaluation rules, and therefore causes JSON Patch (RFC 6902) operations to behave incorrectly.
>>> from jsonpatch import JsonPointer
>>> patch = [{'op': 'test', 'path': '/foo/0', "value": "s"}]
>>> doc = {"foo": "should-not-be-indexable"}
>>> JsonPatch(patch).apply(doc)
{'foo': 'should-not-be-indexable'}
>>> from jsonpatch import JsonPointer
>>> doc = {"foo": "should-not-be-indexable"}
>>> patch = [{'op': 'copy', 'from': '/foo/0', "path": "/bar"}]
>>> JsonPatch(patch).apply(doc)
{'foo': 'should-not-be-indexable', 'bar': 's'}
Upstream issue.