Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-jsonpointer for 
openSUSE:Factory checked in at 2026-11-24 12:22:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonpointer (Old)
 and      /work/SRC/openSUSE:Factory/.python-jsonpointer.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jsonpointer"

Tue Nov 24 12:22:38 2026 rev:25 rq:1399678 version:3.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsonpointer/python-jsonpointer.changes    
2026-10-27 18:20:18.129961843 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-jsonpointer.new.1340718/python-jsonpointer.changes
       2026-11-24 12:23:03.535884026 +0100
@@ -1,0 +2,42 @@
+Sat Nov 21 21:39:46 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 3.12:
+  * Stop using the deprecated argparse.FileType in the CLI
+  * Trim the Sphinx configuration to the settings in use
+  * Pin Sphinx for reproducible documentation builds
+  * Use SPDX identifier for __license__
+  * Deprecate pairwise() in favour of itertools.pairwise()
+  * Ship everything needed to test and build docs from the sdist
+  * Update GitHub Actions to current major versions
+  * Update the tested Python versions
+  * Exit with status 130 when the CLI is interrupted
+  * Keep the original error when join() rejects a suffix
+  * Clean up broken, outdated and redundant bits across the
+    project
+  * **Full Changelog**: https://github.com/stefankoegl/python-
+    json-pointer/compare/v3.11...v3.12
+- update to 3.11:
+  * Allow reflected equality for non-pointer objects
+- update to 3.10:
+  * Don't trigger __missing__ when resolving missing mapping
+    members
+  * **Full Changelog**: https://github.com/stefankoegl/python-
+    json-pointer/compare/v3.9...v3.10
+- update to 3.9:
+  * Test RFC 6901 escaped tilde decoding order
+  * Wrap sequence append type errors in JsonPointerException
+- update to 3.8:
+  * Add type hints via a jsonpointer-stubs package
+  * Check that documentation examples run and produce the
+    expected output
+  * **Full Changelog**: https://github.com/stefankoegl/python-
+    json-pointer/compare/v3.7...v3.8
+- update to 3.7:
+  * Extend CI: package build, docs build, PyPy, Windows/macOS,
+    lint CLI
+  * Report pointer file decoding errors through argparse
+- update to 3.6:
+  * Clarify the direction of pointer containment checks
+  * Close owned CLI input files after reading
+
+-------------------------------------------------------------------

Old:
----
  jsonpointer-3.5.tar.gz

New:
----
  jsonpointer-3.12.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jsonpointer.spec ++++++
--- /var/tmp/diff_new_pack.iCpmFt/_old  2026-11-24 12:23:05.257956988 +0100
+++ /var/tmp/diff_new_pack.iCpmFt/_new  2026-11-24 12:23:05.262957200 +0100
@@ -24,7 +24,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-jsonpointer
-Version:        3.5
+Version:        3.12
 Release:        0
 Summary:        Module to identify specific nodes in a JSON document
 License:        BSD-3-Clause
@@ -77,6 +77,7 @@
 %license LICENSE.txt
 %python_alternative %{_bindir}/jsonpointer
 %{python_sitelib}/jsonpointer.py
+%{python_sitelib}/jsonpointer-stubs
 %pycache_only %{python_sitelib}/__pycache__/jsonpointer.*.pyc
 %{python_sitelib}/jsonpointer-%{version}.dist-info
 

++++++ jsonpointer-3.5.tar.gz -> jsonpointer-3.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/.coveragerc 
new/jsonpointer-3.12/.coveragerc
--- old/jsonpointer-3.5/.coveragerc     1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/.coveragerc    2026-11-11 10:33:44.186418500 +0100
@@ -0,0 +1,12 @@
+# .coveragerc to control coverage.py
+[run]
+branch = True
+
+[report]
+# Regexes for lines to exclude from consideration
+exclude_lines =
+    # Have to re-enable the standard pragma
+    pragma: no cover
+
+    # No need to test __repr__
+    def __repr__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/MANIFEST.in 
new/jsonpointer-3.12/MANIFEST.in
--- old/jsonpointer-3.5/MANIFEST.in     2026-10-24 22:41:28.025525600 +0200
+++ new/jsonpointer-3.12/MANIFEST.in    2026-11-11 10:33:44.187983800 +0100
@@ -1,4 +1,11 @@
 include AUTHORS
 include LICENSE.txt
-include README.md
+include makefile
+include requirements-dev.txt
+include .coveragerc
 include tests.py
+include doc/*.rst
+include doc/conf.py
+include doc/Makefile
+include doc/requirements.txt
+recursive-include jsonpointer-stubs *.pyi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/PKG-INFO 
new/jsonpointer-3.12/PKG-INFO
--- old/jsonpointer-3.5/PKG-INFO        2026-10-24 22:41:46.350471700 +0200
+++ new/jsonpointer-3.12/PKG-INFO       2026-11-11 10:33:54.534453600 +0100
@@ -1,15 +1,14 @@
 Metadata-Version: 2.4
 Name: jsonpointer
-Version: 3.5
+Version: 3.12
 Summary:  Identify specific nodes in a JSON document (RFC 6901) 
 Home-page: https://github.com/stefankoegl/python-json-pointer
 Author: Stefan Kögl
 Author-email: [email protected]
-License: Modified BSD License
+License-Expression: BSD-3-Clause
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3
@@ -18,10 +17,12 @@
 Classifier: Programming Language :: Python :: 3.12
 Classifier: Programming Language :: Python :: 3.13
 Classifier: Programming Language :: Python :: 3.14
+Classifier: Programming Language :: Python :: 3.15
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Software Development :: Libraries
 Classifier: Topic :: Utilities
+Classifier: Typing :: Typed
 Requires-Python: >=3.10
 Description-Content-Type: text/markdown
 License-File: LICENSE.txt
@@ -32,16 +33,16 @@
 Dynamic: description
 Dynamic: description-content-type
 Dynamic: home-page
-Dynamic: license
 Dynamic: license-file
+Dynamic: license-expression
 Dynamic: requires-python
 Dynamic: summary
 
 python-json-pointer
 ===================
 
-[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
+[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
 
[![Tests](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml)
 [![Coverage 
Status](https://coveralls.io/repos/github/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/github/stefankoegl/python-json-pointer?branch=master)
 
@@ -50,12 +51,13 @@
 -------------------------------
 
 Library to resolve JSON Pointers according to
-[RFC 6901](http://tools.ietf.org/html/rfc6901)
+[RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901)
+
+See the documentation for examples.
 
-See source code for examples
 * Website: https://github.com/stefankoegl/python-json-pointer
 * Repository: https://github.com/stefankoegl/python-json-pointer.git
-* Documentation: https://python-json-pointer.readthedocs.org/
-* PyPI: https://pypi.python.org/pypi/jsonpointer
+* Documentation: https://python-json-pointer.readthedocs.io/
+* PyPI: https://pypi.org/project/jsonpointer/
 * GitHub Actions: https://github.com/stefankoegl/python-json-pointer/actions
 * Coveralls: https://coveralls.io/github/stefankoegl/python-json-pointer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/README.md 
new/jsonpointer-3.12/README.md
--- old/jsonpointer-3.5/README.md       2026-10-24 22:41:28.025525600 +0200
+++ new/jsonpointer-3.12/README.md      2026-11-11 10:33:44.187983800 +0100
@@ -1,8 +1,8 @@
 python-json-pointer
 ===================
 
-[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
+[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
 
[![Tests](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml)
 [![Coverage 
Status](https://coveralls.io/repos/github/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/github/stefankoegl/python-json-pointer?branch=master)
 
@@ -11,12 +11,13 @@
 -------------------------------
 
 Library to resolve JSON Pointers according to
-[RFC 6901](http://tools.ietf.org/html/rfc6901)
+[RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901)
+
+See the documentation for examples.
 
-See source code for examples
 * Website: https://github.com/stefankoegl/python-json-pointer
 * Repository: https://github.com/stefankoegl/python-json-pointer.git
-* Documentation: https://python-json-pointer.readthedocs.org/
-* PyPI: https://pypi.python.org/pypi/jsonpointer
+* Documentation: https://python-json-pointer.readthedocs.io/
+* PyPI: https://pypi.org/project/jsonpointer/
 * GitHub Actions: https://github.com/stefankoegl/python-json-pointer/actions
 * Coveralls: https://coveralls.io/github/stefankoegl/python-json-pointer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/bin/jsonpointer 
new/jsonpointer-3.12/bin/jsonpointer
--- old/jsonpointer-3.5/bin/jsonpointer 2026-10-24 22:41:28.025525600 +0200
+++ new/jsonpointer-3.12/bin/jsonpointer        2026-11-11 10:33:44.187983800 
+0100
@@ -13,7 +13,7 @@
 # Accept pointer as option, as file or as first positional argument
 ptr_group = parser.add_mutually_exclusive_group()
 
-ptr_group.add_argument('-f', '--pointer-file', type=argparse.FileType('r', 
encoding='utf-8'),
+ptr_group.add_argument('-f', '--pointer-file', type=str,
                        help='File containing a JSON pointer expression')
 
 ptr_group.add_argument('-p', '--pointer', type=str,
@@ -37,14 +37,28 @@
     try:
         ok = resolve_files()
     except KeyboardInterrupt:
-        sys.exit(1)
+        # Conventional status for termination by SIGINT (128 + 2)
+        sys.exit(130)
 
     if not ok:
         sys.exit(1)
 
 
+def open_input(name):
+    """ Open a UTF-8 input file, or return stdin for "-"
+
+    Exits with a usage error if the file cannot be opened. """
+    if name == '-':
+        return sys.stdin
+
+    try:
+        return open(name, encoding='utf-8')
+    except OSError as e:
+        parser.error("can't open '%s': %s" % (name, e))
+
+
 def parse_pointer(args):
-    """ Return the pointer and the list of files to resolve it on
+    """ Return the parsed pointer and the list of files to resolve it on
 
     If the pointer is given via -f or -p, a POINTER positional argument is
     actually the first file. """
@@ -57,8 +71,16 @@
         if args.pointer is not None:
             ptr = args.pointer
         else:
-            # 2026-10-11: Trim file line endings without changing member names.
-            ptr = args.pointer_file.read().rstrip("\r\n")
+            # Strip only the trailing line ending; other whitespace may be
+            # part of a member name.
+            pointer_file = open_input(args.pointer_file)
+            try:
+                ptr = pointer_file.read().rstrip("\r\n")
+            except UnicodeDecodeError as e:
+                parser.error('could not decode pointer file: %s' % e)
+            finally:
+                if pointer_file is not sys.stdin:
+                    pointer_file.close()
 
     elif args.POINTER is not None:
         ptr = args.POINTER
@@ -69,11 +91,11 @@
     # Catches e.g. `jsonpointer a.json b.json`, where the pointer was omitted
     # and the first file would otherwise be used as the pointer
     try:
-        jsonpointer.JsonPointer(ptr)
+        pointer = jsonpointer.JsonPointer(ptr)
     except jsonpointer.JsonPointerException as e:
         parser.error('invalid JSON pointer %r: %s' % (ptr, e))
 
-    return ptr, files
+    return pointer, files
 
 
 def resolve_files():
@@ -83,14 +105,11 @@
     or if --continue-on-error skipped a JSON or text decoding error. """
     args = parser.parse_args()
 
-    ptr, files = parse_pointer(args)
+    pointer, files = parse_pointer(args)
     ok = True
 
     for name in files:
-        try:
-            f = argparse.FileType('r', encoding='utf-8')(name)
-        except argparse.ArgumentTypeError as e:
-            parser.error(str(e))
+        f = open_input(name)
 
         try:
             doc = json.load(f)
@@ -101,9 +120,12 @@
                   file=sys.stderr)
             ok = False
             continue
+        finally:
+            if f is not sys.stdin:
+                f.close()
 
         try:
-            result = jsonpointer.resolve_pointer(doc, ptr)
+            result = pointer.resolve(doc)
             if isinstance(result, jsonpointer.EndOfList):
                 raise jsonpointer.JsonPointerException(
                     "'-' does not reference an existing array element")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/Makefile 
new/jsonpointer-3.12/doc/Makefile
--- old/jsonpointer-3.5/doc/Makefile    1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/doc/Makefile   2026-11-11 10:33:44.187983800 +0100
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp 
epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+       @echo "Please use \`make <target>' where <target> is one of"
+       @echo "  html       to make standalone HTML files"
+       @echo "  dirhtml    to make HTML files named index.html in directories"
+       @echo "  singlehtml to make a single large HTML file"
+       @echo "  pickle     to make pickle files"
+       @echo "  json       to make JSON files"
+       @echo "  htmlhelp   to make HTML files and a HTML help project"
+       @echo "  qthelp     to make HTML files and a qthelp project"
+       @echo "  devhelp    to make HTML files and a Devhelp project"
+       @echo "  epub       to make an epub"
+       @echo "  latex      to make LaTeX files, you can set PAPER=a4 or 
PAPER=letter"
+       @echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+       @echo "  text       to make text files"
+       @echo "  man        to make manual pages"
+       @echo "  texinfo    to make Texinfo files"
+       @echo "  info       to make Texinfo files and run them through makeinfo"
+       @echo "  gettext    to make PO message catalogs"
+       @echo "  changes    to make an overview of all changed/added/deprecated 
items"
+       @echo "  linkcheck  to check all external links for integrity"
+       @echo "  doctest    to run all doctests embedded in the documentation 
(if enabled)"
+
+clean:
+       -rm -rf $(BUILDDIR)/*
+
+html:
+       $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+       @echo
+       @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+       $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+       @echo
+       @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+       $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+       @echo
+       @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+       $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+       @echo
+       @echo "Build finished; now you can process the pickle files."
+
+json:
+       $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+       @echo
+       @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+       $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+       @echo
+       @echo "Build finished; now you can run HTML Help Workshop with the" \
+             ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+       $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+       @echo
+       @echo "Build finished; now you can run "qcollectiongenerator" with the" 
\
+             ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+       @echo "# qcollectiongenerator 
$(BUILDDIR)/qthelp/python-json-pointer.qhcp"
+       @echo "To view the help file:"
+       @echo "# assistant -collectionFile 
$(BUILDDIR)/qthelp/python-json-pointer.qhc"
+
+devhelp:
+       $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+       @echo
+       @echo "Build finished."
+       @echo "To view the help file:"
+       @echo "# mkdir -p $$HOME/.local/share/devhelp/python-json-pointer"
+       @echo "# ln -s $(BUILDDIR)/devhelp 
$$HOME/.local/share/devhelp/python-json-pointer"
+       @echo "# devhelp"
+
+epub:
+       $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+       @echo
+       @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+       $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+       @echo
+       @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+       @echo "Run \`make' in that directory to run these through (pdf)latex" \
+             "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+       $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+       @echo "Running LaTeX files through pdflatex..."
+       $(MAKE) -C $(BUILDDIR)/latex all-pdf
+       @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+       $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+       @echo
+       @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+       $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+       @echo
+       @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+       $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+       @echo
+       @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+       @echo "Run \`make' in that directory to run these through makeinfo" \
+             "(use \`make info' here to do that automatically)."
+
+info:
+       $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+       @echo "Running Texinfo files through makeinfo..."
+       make -C $(BUILDDIR)/texinfo info
+       @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+       $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+       @echo
+       @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+       $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+       @echo
+       @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+       $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+       @echo
+       @echo "Link check complete; look for any errors in the above output " \
+             "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+       $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+       @echo "Testing of doctests in the sources finished, look at the " \
+             "results in $(BUILDDIR)/doctest/output.txt."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/commandline.rst 
new/jsonpointer-3.12/doc/commandline.rst
--- old/jsonpointer-3.5/doc/commandline.rst     1970-01-01 01:00:00.000000000 
+0100
+++ new/jsonpointer-3.12/doc/commandline.rst    2026-11-11 10:33:44.188368300 
+0100
@@ -0,0 +1,76 @@
+The ``jsonpointer`` commandline utility
+=======================================
+
+The JSON pointer package also installs a ``jsonpointer`` commandline utility
+that can be used to resolve a JSON pointer on JSON files.
+
+The program has the following usage ::
+
+    usage: jsonpointer [-h] [-f POINTER_FILE | -p POINTER] [--indent INDENT]
+                       [--continue-on-error] [-v]
+                       [POINTER] FILE [FILE ...]
+
+    Resolve a JSON pointer on JSON files
+
+    positional arguments:
+      POINTER               A JSON pointer expression (if neither -f nor -p is
+                            given)
+      FILE                  Files for which the pointer should be resolved
+
+    options:
+      -h, --help            show this help message and exit
+      -f, --pointer-file POINTER_FILE
+                            File containing a JSON pointer expression
+      -p, --pointer POINTER
+                            A JSON pointer expression
+      --indent INDENT       Indent output by n spaces
+      --continue-on-error   Continue with remaining files after JSON or text
+                            decoding errors
+      -v, --version         show program's version number and exit
+
+The pointer can be passed as the first positional argument, with ``-p``, or
+read from a file with ``-f``.
+
+JSON input files and pointer files are read as UTF-8.
+
+The exit status is 0 if the pointer could be resolved on all files, 1 if it
+could not be resolved on at least one file (the remaining files are still
+processed), 2 on usage errors, such as an invalid pointer or a missing
+file, and 130 if interrupted with Ctrl-C.
+
+By default, invalid JSON or a text decoding error stops processing. With
+``--continue-on-error``, these errors are reported on standard error with
+the file name and decoder details, and the remaining files are processed.
+The exit status is 1 if any file has such an error, even if later files
+succeed. Missing files and other usage errors still stop processing with
+status 2.
+
+Example
+^^^^^^^
+
+.. code-block:: bash
+
+    # inspect JSON files
+    $ cat a.json
+    { "a": [1, 2, 3] }
+
+    $ cat b.json
+    { "a": {"b": [1, 3, 4]}, "b": 1 }
+
+    # resolve JSON pointer
+    $ jsonpointer /a a.json b.json
+    [1, 2, 3]
+    {"b": [1, 3, 4]}
+
+    # same, using the -p option
+    $ jsonpointer -p /a a.json b.json
+    [1, 2, 3]
+    {"b": [1, 3, 4]}
+
+    # same, reading the pointer from a file
+    $ cat ptr.txt
+    /a
+
+    $ jsonpointer -f ptr.txt a.json b.json
+    [1, 2, 3]
+    {"b": [1, 3, 4]}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/conf.py 
new/jsonpointer-3.12/doc/conf.py
--- old/jsonpointer-3.5/doc/conf.py     1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/doc/conf.py    2026-11-11 10:33:44.188368300 +0100
@@ -0,0 +1,47 @@
+# Sphinx configuration for the python-json-pointer documentation.
+# See https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+import os
+import sys
+
+# Document the jsonpointer module from this checkout
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 
'..'))
+
+import jsonpointer  # noqa: E402
+
+# -- Project information 
-------------------------------------------------------
+
+project = 'python-json-pointer'
+author = 'Stefan Kögl'
+copyright = jsonpointer.__author__
+version = jsonpointer.__version__
+release = jsonpointer.__version__
+
+# -- General configuration 
-----------------------------------------------------
+
+extensions = ['sphinx.ext.autodoc']
+exclude_patterns = ['_build']
+pygments_style = 'sphinx'
+
+# -- Options for HTML output 
---------------------------------------------------
+
+html_theme = 'classic'
+htmlhelp_basename = 'python-json-pointerdoc'
+
+# -- Options for other output formats 
------------------------------------------
+
+latex_documents = [
+    ('index', 'python-json-pointer.tex', 'python-json-pointer Documentation',
+     author, 'manual'),
+]
+
+man_pages = [
+    ('index', 'python-json-pointer', 'python-json-pointer Documentation',
+     [author], 1),
+]
+
+texinfo_documents = [
+    ('index', 'python-json-pointer', 'python-json-pointer Documentation',
+     author, 'python-json-pointer', jsonpointer.__doc__.strip(),
+     'Miscellaneous'),
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/index.rst 
new/jsonpointer-3.12/doc/index.rst
--- old/jsonpointer-3.5/doc/index.rst   1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/doc/index.rst  2026-11-11 10:33:44.188368300 +0100
@@ -0,0 +1,30 @@
+.. python-json-pointer documentation master file, created by
+   sphinx-quickstart on Sat Apr 13 16:52:59 2013.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+python-json-pointer
+===================
+
+*python-json-pointer* is a Python library for resolving JSON pointers (`RFC
+6901 <https://datatracker.ietf.org/doc/html/rfc6901>`_). Python 3.10+
+and PyPy are supported.
+
+**Contents**
+
+.. toctree::
+   :maxdepth: 2
+
+   tutorial
+   mod-jsonpointer
+   commandline
+   RFC 6901 <https://datatracker.ietf.org/doc/html/rfc6901>
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/mod-jsonpointer.rst 
new/jsonpointer-3.12/doc/mod-jsonpointer.rst
--- old/jsonpointer-3.5/doc/mod-jsonpointer.rst 1970-01-01 01:00:00.000000000 
+0100
+++ new/jsonpointer-3.12/doc/mod-jsonpointer.rst        2026-11-11 
10:33:44.188368300 +0100
@@ -0,0 +1,7 @@
+.. _mod-jsonpointer:
+
+The ``jsonpointer`` module
+==========================
+
+.. automodule:: jsonpointer
+   :members:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/requirements.txt 
new/jsonpointer-3.12/doc/requirements.txt
--- old/jsonpointer-3.5/doc/requirements.txt    1970-01-01 01:00:00.000000000 
+0100
+++ new/jsonpointer-3.12/doc/requirements.txt   2026-11-11 10:33:44.188368300 
+0100
@@ -0,0 +1 @@
+sphinx==9.2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/doc/tutorial.rst 
new/jsonpointer-3.12/doc/tutorial.rst
--- old/jsonpointer-3.5/doc/tutorial.rst        1970-01-01 01:00:00.000000000 
+0100
+++ new/jsonpointer-3.12/doc/tutorial.rst       2026-11-11 10:33:44.188368300 
+0100
@@ -0,0 +1,107 @@
+Tutorial
+========
+
+Please refer to `RFC 6901 <https://datatracker.ietf.org/doc/html/rfc6901>`_ 
for the exact
+pointer syntax. The ``resolve_pointer``
+function is basically a deep ``get``.
+
+.. code-block:: python
+
+    >>> from jsonpointer import resolve_pointer
+    >>> obj = {"foo": {"anArray": [ {"prop": 44}], "another prop": {"baz": "A 
string" }}}
+
+    >>> resolve_pointer(obj, '') == obj
+    True
+
+    >>> resolve_pointer(obj, '/foo') == obj['foo']
+    True
+
+    >>> resolve_pointer(obj, '/foo/another prop') == obj['foo']['another prop']
+    True
+
+    >>> resolve_pointer(obj, '/foo/another prop/baz') == obj['foo']['another 
prop']['baz']
+    True
+
+    >>> resolve_pointer(obj, '/foo/anArray/0') == obj['foo']['anArray'][0]
+    True
+
+    >>> resolve_pointer(obj, '/some/path', None) == None
+    True
+
+
+The ``set_pointer`` function allows modifying a portion of an object using
+JSON pointer notation:
+
+.. code-block:: python
+
+    >>> from jsonpointer import set_pointer
+    >>> obj = {"foo": {"anArray": [ {"prop": 44}], "another prop": {"baz": "A 
string" }}}
+
+    >>> set_pointer(obj, '/foo/anArray/0/prop', 55)
+    {'foo': {'anArray': [{'prop': 55}], 'another prop': {'baz': 'A string'}}}
+
+    >>> obj
+    {'foo': {'anArray': [{'prop': 55}], 'another prop': {'baz': 'A string'}}}
+
+By default ``set_pointer`` modifies the original object.  Pass 
``inplace=False``
+to create a copy and modify the copy instead:
+
+    >>> from jsonpointer import set_pointer
+    >>> obj = {"foo": {"anArray": [ {"prop": 44}], "another prop": {"baz": "A 
string" }}}
+
+    >>> set_pointer(obj, '/foo/anArray/0/prop', 55, inplace=False)
+    {'foo': {'anArray': [{'prop': 55}], 'another prop': {'baz': 'A string'}}}
+
+    >>> obj
+    {'foo': {'anArray': [{'prop': 44}], 'another prop': {'baz': 'A string'}}}
+
+By default, setting a value below a member that does not exist raises a
+``JsonPointerException``. Pass ``create=True`` to create missing members as
+dicts instead. Missing list elements can be created by referencing the end of
+the list, either with ``-`` or with an index equal to the length of the list:
+
+    >>> from jsonpointer import set_pointer
+    >>> obj = {}
+
+    >>> set_pointer(obj, '/cat/name', 'whiskers', create=True)
+    {'cat': {'name': 'whiskers'}}
+
+    >>> obj = {'cats': []}
+
+    >>> set_pointer(obj, '/cats/-/name', 'whiskers', create=True)
+    {'cats': [{'name': 'whiskers'}]}
+
+The ``JsonPointer`` class wraps a (string) path and can be used to access the
+same path on several objects.
+
+.. code-block:: python
+
+    >>> import jsonpointer
+
+    >>> pointer = jsonpointer.JsonPointer('/foo/1')
+
+    >>> obj1 = {'foo': ['a', 'b', 'c']}
+    >>> pointer.resolve(obj1)
+    'b'
+
+    >>> obj2 = {'foo': {'0': 1, '1': 10, '2': 100}}
+    >>> pointer.resolve(obj2)
+    10
+
+Checking pointer prefixes
+-------------------------
+
+``child.contains(parent)`` checks whether the parent's parts are a prefix of
+the child's parts. The equivalent membership expression is ``parent in child``.
+The comparison is between whole path parts, so ``/foo/b`` is not a prefix of
+``/foo/bar``. Equal pointers and the root pointer are prefixes too:
+
+    >>> from jsonpointer import JsonPointer
+    >>> parent = JsonPointer('/foo')
+    >>> child = JsonPointer('/foo/bar')
+    >>> child.contains(parent)
+    True
+    >>> parent in child
+    True
+    >>> child in parent
+    False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/jsonpointer-stubs/__init__.pyi 
new/jsonpointer-3.12/jsonpointer-stubs/__init__.pyi
--- old/jsonpointer-3.5/jsonpointer-stubs/__init__.pyi  1970-01-01 
01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/jsonpointer-stubs/__init__.pyi 2026-11-11 
10:33:44.188368300 +0100
@@ -0,0 +1,64 @@
+from collections.abc import Iterable, Iterator
+from re import Pattern
+from typing import Any, Final, TypeVar
+
+from typing_extensions import Self, deprecated
+
+_T = TypeVar("_T")
+
+__author__: Final[str]
+__version__: Final[str]
+__website__: Final[str]
+__license__: Final[str]
+
+VERBOSE_EXCEPTIONS: bool
+
+def set_pointer(
+    doc: Any,
+    pointer: str,
+    value: Any,
+    inplace: bool = True,
+    create: bool = False,
+) -> Any: ...
+def resolve_pointer(doc: Any, pointer: str, default: Any = ...) -> Any: ...
+@deprecated("Use itertools.pairwise() instead")
+def pairwise(iterable: Iterable[_T]) -> Iterator[tuple[_T, _T]]: ...
+
+class JsonPointerException(Exception): ...
+
+class EndOfList:
+    list_: Any
+    def __init__(self, list_: Any) -> None: ...
+
+class JsonPointer:
+    _RE_ARRAY_INDEX: Pattern[str]
+    _RE_INVALID_ESCAPE: Pattern[str]
+    parts: list[str]
+    def __init__(self, pointer: str) -> None: ...
+    def to_last(self, doc: Any) -> tuple[Any, str | int | None]: ...
+    def resolve(self, doc: Any, default: Any = ...) -> Any: ...
+    def get(self, doc: Any, default: Any = ...) -> Any: ...
+    def set(
+        self,
+        doc: Any,
+        value: Any,
+        inplace: bool = True,
+        create: bool = False,
+    ) -> Any: ...
+    @classmethod
+    def get_part(cls, doc: Any, part: str | int) -> str | int: ...
+    def get_parts(self) -> list[str]: ...
+    def walk(self, doc: Any, part: str | int) -> Any: ...
+    def contains(self, ptr: JsonPointer) -> bool: ...
+    def __contains__(self, item: JsonPointer) -> bool: ...
+    def join(self, suffix: JsonPointer | str | Iterable[object]) -> Self: ...
+    def __truediv__(self, suffix: JsonPointer | str | Iterable[object]) -> 
Self: ...
+    @property
+    def path(self) -> str: ...
+    def __eq__(self, other: object) -> bool: ...
+    def __hash__(self) -> int: ...
+    @classmethod
+    def from_parts(cls, parts: Iterable[object]) -> Self: ...
+
+def escape(s: str) -> str: ...
+def unescape(s: str) -> str: ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/jsonpointer.egg-info/PKG-INFO 
new/jsonpointer-3.12/jsonpointer.egg-info/PKG-INFO
--- old/jsonpointer-3.5/jsonpointer.egg-info/PKG-INFO   2026-10-24 
22:41:46.333826500 +0200
+++ new/jsonpointer-3.12/jsonpointer.egg-info/PKG-INFO  2026-11-11 
10:33:54.518475800 +0100
@@ -1,15 +1,14 @@
 Metadata-Version: 2.4
 Name: jsonpointer
-Version: 3.5
+Version: 3.12
 Summary:  Identify specific nodes in a JSON document (RFC 6901) 
 Home-page: https://github.com/stefankoegl/python-json-pointer
 Author: Stefan Kögl
 Author-email: [email protected]
-License: Modified BSD License
+License-Expression: BSD-3-Clause
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3
@@ -18,10 +17,12 @@
 Classifier: Programming Language :: Python :: 3.12
 Classifier: Programming Language :: Python :: 3.13
 Classifier: Programming Language :: Python :: 3.14
+Classifier: Programming Language :: Python :: 3.15
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Software Development :: Libraries
 Classifier: Topic :: Utilities
+Classifier: Typing :: Typed
 Requires-Python: >=3.10
 Description-Content-Type: text/markdown
 License-File: LICENSE.txt
@@ -32,16 +33,16 @@
 Dynamic: description
 Dynamic: description-content-type
 Dynamic: home-page
-Dynamic: license
 Dynamic: license-file
+Dynamic: license-expression
 Dynamic: requires-python
 Dynamic: summary
 
 python-json-pointer
 ===================
 
-[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
+[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.org/project/jsonpointer/)
 
[![Tests](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml)
 [![Coverage 
Status](https://coveralls.io/repos/github/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/github/stefankoegl/python-json-pointer?branch=master)
 
@@ -50,12 +51,13 @@
 -------------------------------
 
 Library to resolve JSON Pointers according to
-[RFC 6901](http://tools.ietf.org/html/rfc6901)
+[RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901)
+
+See the documentation for examples.
 
-See source code for examples
 * Website: https://github.com/stefankoegl/python-json-pointer
 * Repository: https://github.com/stefankoegl/python-json-pointer.git
-* Documentation: https://python-json-pointer.readthedocs.org/
-* PyPI: https://pypi.python.org/pypi/jsonpointer
+* Documentation: https://python-json-pointer.readthedocs.io/
+* PyPI: https://pypi.org/project/jsonpointer/
 * GitHub Actions: https://github.com/stefankoegl/python-json-pointer/actions
 * Coveralls: https://coveralls.io/github/stefankoegl/python-json-pointer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/jsonpointer.egg-info/SOURCES.txt 
new/jsonpointer-3.12/jsonpointer.egg-info/SOURCES.txt
--- old/jsonpointer-3.5/jsonpointer.egg-info/SOURCES.txt        2026-10-24 
22:41:46.344108300 +0200
+++ new/jsonpointer-3.12/jsonpointer.egg-info/SOURCES.txt       2026-11-11 
10:33:54.528700000 +0100
@@ -1,12 +1,24 @@
+.coveragerc
 AUTHORS
 LICENSE.txt
 MANIFEST.in
 README.md
 jsonpointer.py
+makefile
+pyproject.toml
+requirements-dev.txt
 setup.cfg
 setup.py
 tests.py
 bin/jsonpointer
+doc/Makefile
+doc/commandline.rst
+doc/conf.py
+doc/index.rst
+doc/mod-jsonpointer.rst
+doc/requirements.txt
+doc/tutorial.rst
+jsonpointer-stubs/__init__.pyi
 jsonpointer.egg-info/PKG-INFO
 jsonpointer.egg-info/SOURCES.txt
 jsonpointer.egg-info/dependency_links.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/jsonpointer.egg-info/top_level.txt 
new/jsonpointer-3.12/jsonpointer.egg-info/top_level.txt
--- old/jsonpointer-3.5/jsonpointer.egg-info/top_level.txt      2026-10-24 
22:41:46.334425700 +0200
+++ new/jsonpointer-3.12/jsonpointer.egg-info/top_level.txt     2026-11-11 
10:33:54.519139500 +0100
@@ -1 +1,2 @@
 jsonpointer
+jsonpointer-stubs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/jsonpointer.py 
new/jsonpointer-3.12/jsonpointer.py
--- old/jsonpointer-3.5/jsonpointer.py  2026-10-24 22:41:28.026069000 +0200
+++ new/jsonpointer-3.12/jsonpointer.py 2026-11-11 10:33:44.188368300 +0100
@@ -32,14 +32,16 @@
 
 # Will be parsed by setup.py to determine package metadata
 __author__ = 'Stefan Kögl <[email protected]>'
-__version__ = '3.5'
+__version__ = '3.12'
 __website__ = 'https://github.com/stefankoegl/python-json-pointer'
-__license__ = 'Modified BSD License'
+__license__ = 'BSD-3-Clause'
 
 import copy
+import itertools
 import re
+import warnings
 from collections.abc import Mapping, Sequence
-from itertools import tee, chain
+from itertools import chain
 
 _nothing = object()
 
@@ -128,19 +130,13 @@
 
     s -> (s0,s1), (s1,s2), (s2, s3), ...
 
-    >>> list(pairwise([]))
-    []
-
-    >>> list(pairwise([1]))
-    []
-
-    >>> list(pairwise([1, 2, 3, 4]))
-    [(1, 2), (2, 3), (3, 4)]
+    .. deprecated:: 3.12
+       Use :func:`itertools.pairwise` instead.
     """
-    a, b = tee(iterable)
-    for _ in b:
-        break
-    return zip(a, b)
+    warnings.warn('jsonpointer.pairwise() is deprecated, '
+                  'use itertools.pairwise() instead',
+                  DeprecationWarning, stacklevel=2)
+    return itertools.pairwise(iterable)
 
 
 class JsonPointerException(Exception):
@@ -163,7 +159,7 @@
 
     # Array indices must not contain:
     # leading zeros, signs, spaces, decimals, etc
-    _RE_ARRAY_INDEX = re.compile('0|[1-9][0-9]*$')
+    _RE_ARRAY_INDEX = re.compile('0|[1-9][0-9]*')
     _RE_INVALID_ESCAPE = re.compile('(~[^01]|~$)')
 
     def __init__(self, pointer):
@@ -275,8 +271,9 @@
         elif isinstance(parent, Sequence) and part == '-':
             try:
                 parent.append(value)
-            except AttributeError as e:
-                # immutable sequences, such as tuples, can't be appended to
+            except (AttributeError, TypeError) as e:
+                # Immutable sequences can't be appended to; typed sequences
+                # can reject the value just like an indexed assignment.
                 raise JsonPointerException("Invalid assignment target: %s" % 
(e,))
         else:
             try:
@@ -326,8 +323,6 @@
 
         part = JsonPointer.get_part(doc, part)
 
-        assert hasattr(doc, '__getitem__'), "invalid document type %s" % 
(type(doc),)
-
         if isinstance(doc, Sequence):
             if part == '-':
                 return EndOfList(doc)
@@ -340,6 +335,12 @@
 
         # Else the object is a mapping or supports __getitem__(so assume 
custom indexing)
         try:
+            # Check membership first so that mappings with a fallback for
+            # missing keys (e.g. defaultdict.__missing__) are not mutated and
+            # absent members are reported as missing.
+            if isinstance(doc, Mapping) and part not in doc:
+                raise KeyError(part)
+
             return doc[part]
 
         except KeyError:
@@ -349,15 +350,38 @@
                 raise JsonPointerException("member '%s' not found" % (part,))
 
     def contains(self, ptr):
-        """ Returns True if self contains the given ptr """
+        """Returns True if ptr's parts are a prefix of this pointer's parts.
+
+        Equal pointers and the root pointer are also prefixes. For example,
+        the longer pointer calls contains() with its parent:
+
+        >>> child = JsonPointer('/foo/bar')
+        >>> parent = JsonPointer('/foo')
+        >>> child.contains(parent)
+        True
+        >>> parent.contains(child)
+        False
+        >>> child.contains(child)
+        True
+        >>> child.contains(JsonPointer(''))
+        True
+        >>> child.contains(JsonPointer('/foo/b'))
+        False
+        """
         return self.parts[:len(ptr.parts)] == ptr.parts
 
     def __contains__(self, item):
-        """ Returns True if self contains the given ptr """
+        """Equivalent to contains(): item must be a prefix of self.
+
+        >>> JsonPointer('/foo') in JsonPointer('/foo/bar')
+        True
+        >>> JsonPointer('/foo/bar') in JsonPointer('/foo')
+        False
+        """
         return self.contains(item)
 
     def join(self, suffix):
-        """ Returns a new JsonPointer with the given suffix append to this ptr 
"""
+        """ Returns a new JsonPointer with the given suffix appended to this 
ptr """
         if isinstance(suffix, JsonPointer):
             suffix_parts = suffix.parts
         elif isinstance(suffix, str):
@@ -366,8 +390,8 @@
             suffix_parts = suffix
         try:
             return self.__class__.from_parts(chain(self.parts, suffix_parts))
-        except Exception:
-            raise JsonPointerException("Invalid suffix")
+        except Exception as e:
+            raise JsonPointerException("Invalid suffix") from e
 
     def __truediv__(self, suffix):
         return self.join(suffix)
@@ -376,7 +400,8 @@
     def path(self):
         """Returns the string representation of the pointer
 
-        >>> ptr = JsonPointer('/~0/0/~1').path == '/~0/0/~1'
+        >>> JsonPointer('/~0/0/~1').path == '/~0/0/~1'
+        True
         """
         parts = [escape(part) for part in self.parts]
         return ''.join('/' + part for part in parts)
@@ -384,13 +409,13 @@
     def __eq__(self, other):
         """Compares a pointer to another object
 
-        Pointers can be compared by comparing their strings (or splitted
+        Pointers can be compared by comparing their strings (or split
         strings), because no two different parts can point to the same
         structure in an object (eg no different number representations)
         """
 
         if not isinstance(other, JsonPointer):
-            return False
+            return NotImplemented
 
         return self.parts == other.parts
 
@@ -405,7 +430,7 @@
 
     @classmethod
     def from_parts(cls, parts):
-        """Constructs a JsonPointer from a list of (unescaped) paths
+        """Constructs a JsonPointer from a list of (unescaped) parts
 
         >>> JsonPointer.from_parts(['a', '~', '/', 0]).path == '/a/~0/~1/0'
         True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/makefile 
new/jsonpointer-3.12/makefile
--- old/jsonpointer-3.5/makefile        1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/makefile       2026-11-11 10:33:44.188368300 +0100
@@ -0,0 +1,17 @@
+
+help:
+       @echo "jsonpointer"
+       @echo "Makefile targets"
+       @echo " - test: run tests"
+       @echo " - coverage: run tests with coverage"
+       @echo
+       @echo "To install jsonpointer, type"
+       @echo "  pip install ."
+       @echo
+
+test:
+       python3 -munittest
+
+coverage:
+       coverage run --source=jsonpointer -m unittest
+       coverage report -m
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/pyproject.toml 
new/jsonpointer-3.12/pyproject.toml
--- old/jsonpointer-3.5/pyproject.toml  1970-01-01 01:00:00.000000000 +0100
+++ new/jsonpointer-3.12/pyproject.toml 2026-11-11 10:33:44.188368300 +0100
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools>=77.0"]
+build-backend = "setuptools.build_meta"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/requirements-dev.txt 
new/jsonpointer-3.12/requirements-dev.txt
--- old/jsonpointer-3.5/requirements-dev.txt    1970-01-01 01:00:00.000000000 
+0100
+++ new/jsonpointer-3.12/requirements-dev.txt   2026-11-11 10:33:44.188368300 
+0100
@@ -0,0 +1,2 @@
+coverage
+flake8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/setup.cfg 
new/jsonpointer-3.12/setup.cfg
--- old/jsonpointer-3.5/setup.cfg       2026-10-24 22:41:46.350867500 +0200
+++ new/jsonpointer-3.12/setup.cfg      2026-11-11 10:33:54.534812200 +0100
@@ -1,5 +1,6 @@
 [flake8]
 max-line-length = 120
+filename = *.py,./bin/jsonpointer
 exclude = .git,.tox,dist,doc,*egg,build,.venv
 
 [egg_info]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/setup.py 
new/jsonpointer-3.12/setup.py
--- old/jsonpointer-3.5/setup.py        2026-10-24 22:41:28.026069000 +0200
+++ new/jsonpointer-3.12/setup.py       2026-11-11 10:33:44.188368300 +0100
@@ -1,6 +1,5 @@
 #!/usr/bin/env python
 
-import io
 import os.path
 import re
 
@@ -8,7 +7,8 @@
 
 dirname = os.path.dirname(os.path.abspath(__file__))
 filename = os.path.join(dirname, 'jsonpointer.py')
-src = io.open(filename, encoding='utf-8').read()
+with open(filename, encoding='utf-8') as f:
+    src = f.read()
 metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", src))
 docstrings = re.findall('"""(.*)"""', src)
 
@@ -21,20 +21,18 @@
 AUTHOR_EMAIL = metadata['author']
 VERSION = metadata['version']
 WEBSITE = metadata['website']
-LICENSE = metadata['license']
 DESCRIPTION = docstrings[0]
 
 # Extract name and e-mail ("Firstname Lastname <[email protected]>")
 AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
 
-with open('README.md') as readme:
+with open(os.path.join(dirname, 'README.md'), encoding='utf-8') as readme:
     long_description = readme.read()
 
 CLASSIFIERS = [
     'Development Status :: 5 - Production/Stable',
     'Environment :: Console',
     'Intended Audience :: Developers',
-    'License :: OSI Approved :: BSD License',
     'Operating System :: OS Independent',
     'Programming Language :: Python',
     'Programming Language :: Python :: 3',
@@ -43,10 +41,12 @@
     'Programming Language :: Python :: 3.12',
     'Programming Language :: Python :: 3.13',
     'Programming Language :: Python :: 3.14',
+    'Programming Language :: Python :: 3.15',
     'Programming Language :: Python :: Implementation :: CPython',
     'Programming Language :: Python :: Implementation :: PyPy',
     'Topic :: Software Development :: Libraries',
     'Topic :: Utilities',
+    'Typing :: Typed',
 ]
 
 setup(
@@ -57,9 +57,12 @@
     long_description_content_type="text/markdown",
     author=AUTHOR,
     author_email=EMAIL,
-    license=LICENSE,
+    license_expression='BSD-3-Clause',
     url=WEBSITE,
     py_modules=MODULES,
+    # PEP 561 stub-only package, shipped in the same distribution
+    packages=['jsonpointer-stubs'],
+    package_data={'jsonpointer-stubs': ['__init__.pyi']},
     scripts=['bin/jsonpointer'],
     classifiers=CLASSIFIERS,
     python_requires='>=3.10',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-3.5/tests.py 
new/jsonpointer-3.12/tests.py
--- old/jsonpointer-3.5/tests.py        2026-10-24 22:41:28.026069000 +0200
+++ new/jsonpointer-3.12/tests.py       2026-11-11 10:33:44.188368300 +0100
@@ -2,12 +2,19 @@
 
 import copy
 import doctest
+import io
 import json
 import os
+import runpy
+import shlex
 import subprocess
 import sys
 import tempfile
+import textwrap
 import unittest
+from collections import defaultdict
+from contextlib import redirect_stderr, redirect_stdout
+from unittest import mock
 
 import jsonpointer
 from jsonpointer import resolve_pointer, EndOfList, JsonPointerException, \
@@ -77,6 +84,17 @@
             new_ptr = JsonPointer.from_parts(parts)
             self.assertEqual(ptr, new_ptr)
 
+    def test_escaped_tilde_is_not_decoded_twice(self):
+        # RFC 6901 section 4: decode ~1 before ~0, so ~01 becomes ~1, not /.
+        pointer = JsonPointer('/~01')
+        self.assertEqual(pointer.parts, ['~1'])
+        self.assertEqual(JsonPointer.from_parts(pointer.parts).path, '/~01')
+
+        doc = {'~1': 'tilde member', '/': 'slash member'}
+        self.assertEqual(resolve_pointer(doc, '/~01'), 'tilde member')
+        set_pointer(doc, '/~01', 'updated')
+        self.assertEqual(doc, {'~1': 'updated', '/': 'slash member'})
+
     def test_str_and_repr(self):
         paths = [
             ("", "", "JsonPointer('')"),
@@ -153,6 +171,23 @@
         # a pointer compares not-equal to objects of other types
         self.assertFalse(p1 == "/something/1/b")
 
+    def test_other_types_remain_unequal(self):
+        for other in ["/a/b/c", None, 1, object()]:
+            for left, right in [(self.ptr1, other), (other, self.ptr1)]:
+                with self.subTest(left=left, right=right):
+                    self.assertFalse(left == right)
+                    self.assertTrue(left != right)
+
+    def test_reflected_equality(self):
+        for left, right in [(self.ptr1, mock.ANY), (mock.ANY, self.ptr1)]:
+            with self.subTest(left=left, right=right):
+                self.assertTrue(left == right)
+
+    def test_reflected_inequality(self):
+        for left, right in [(self.ptr1, mock.ANY), (mock.ANY, self.ptr1)]:
+            with self.subTest(left=left, right=right):
+                self.assertFalse(left != right)
+
     def test_contains(self):
         self.assertTrue(self.ptr1.contains(self.ptr2))
         self.assertTrue(self.ptr1.contains(self.ptr1))
@@ -181,6 +216,11 @@
 
         self.assertRaises(JsonPointerException, self.ptr1.join, 0)
 
+    def test_join_chains_original_error(self):
+        with self.assertRaises(JsonPointerException) as caught:
+            self.ptr1.join(0)
+        self.assertIsInstance(caught.exception.__cause__, TypeError)
+
     def test_join_magic(self):
         ptr12a = self.ptr1 / self.ptr2
         self.assertEqual(ptr12a.path, "/a/b/c/a/b")
@@ -272,6 +312,17 @@
 
 @unittest.skipUnless(hasattr(sys, 'get_int_max_str_digits'),
                      'Integer string conversion limits are not available')
+class PairwiseTests(unittest.TestCase):
+
+    def test_pairwise_is_deprecated(self):
+        for items, expected in (([], []), ([1], []),
+                                ([1, 2, 3, 4], [(1, 2), (2, 3), (3, 4)])):
+            with self.subTest(items=items):
+                with self.assertWarns(DeprecationWarning):
+                    result = jsonpointer.pairwise(items)
+                self.assertEqual(list(result), expected)
+
+
 class LargeIndexTests(unittest.TestCase):
 
     def setUp(self):
@@ -450,6 +501,34 @@
                           "/cat/name", "whiskers")
         self.assertEqual(doc, {})
 
+    def test_set_sequence_append_invalid_type(self):
+        for pointer, create in (("/items/0", False), ("/items/-", False),
+                                ("/items/-", True), ("/items/1", True)):
+            for inplace in (False, True):
+                with self.subTest(pointer=pointer, create=create, 
inplace=inplace):
+                    doc = {"items": bytearray([1])}
+                    with self.assertRaisesRegex(JsonPointerException, "Invalid 
assignment target:"):
+                        set_pointer(doc, pointer, "invalid", inplace=inplace, 
create=create)
+                    self.assertEqual(doc, {"items": bytearray([1])})
+
+    def test_set_create_sequence_append_invalid_child(self):
+        for pointer in ("/items/-/leaf", "/items/1/leaf"):
+            with self.subTest(pointer=pointer):
+                doc = {"items": bytearray([1])}
+                with self.assertRaisesRegex(JsonPointerException, "Invalid 
assignment target:"):
+                    set_pointer(doc, pointer, 7, create=True)
+                self.assertEqual(doc, {"items": bytearray([1])})
+
+    def test_set_sequence_append_valid_type(self):
+        for pointer, create in (("/items/-", False), ("/items/-", True),
+                                ("/items/1", True)):
+            for inplace in (False, True):
+                with self.subTest(pointer=pointer, create=create, 
inplace=inplace):
+                    doc = {"items": bytearray([1])}
+                    result = set_pointer(doc, pointer, 2, inplace=inplace, 
create=create)
+                    self.assertEqual(result, {"items": bytearray([1, 2])})
+                    self.assertEqual(doc, result if inplace else {"items": 
bytearray([1])})
+
 
 class AltTypesTests(unittest.TestCase):
     class Node(object):
@@ -548,6 +627,35 @@
         self.assertRaises(JsonPointerException, resolve_pointer, doc, 
'/root/1/2/3/4')
 
 
+class DefaultDictTests(unittest.TestCase):
+    """Missing members of mappings with __missing__ must stay missing (#101)"""
+
+    def test_resolve_missing_returns_default(self):
+        doc = defaultdict(dict)
+        self.assertEqual(resolve_pointer(doc, '/missing', 'SENTINEL'), 
'SENTINEL')
+        self.assertEqual(dict(doc), {})
+
+    def test_resolve_missing_raises(self):
+        doc = defaultdict(dict)
+        self.assertRaises(JsonPointerException, resolve_pointer, doc, 
'/missing')
+        self.assertEqual(dict(doc), {})
+
+    def test_resolve_existing_member(self):
+        doc = defaultdict(dict, {'foo': {'bar': 1}})
+        self.assertEqual(resolve_pointer(doc, '/foo/bar'), 1)
+
+    def test_set_without_create_raises(self):
+        doc = defaultdict(dict)
+        self.assertRaises(JsonPointerException, set_pointer, doc,
+                          '/missing/child', 1)
+        self.assertEqual(dict(doc), {})
+
+    def test_set_with_create(self):
+        doc = defaultdict(dict)
+        set_pointer(doc, '/missing/child', 1, create=True)
+        self.assertEqual(dict(doc), {'missing': {'child': 1}})
+
+
 class CommandLineTests(unittest.TestCase):
     """ Tests the jsonpointer command line utility """
 
@@ -580,6 +688,98 @@
                               cwd=self.dir, env=env, capture_output=True,
                               encoding='utf-8')
 
+    def _run_with_retained_files(self, *args):
+        cli = runpy.run_path(self.SCRIPT)
+        opened = []
+        original_open = open
+
+        def retain_file(*args, **kwargs):
+            file_obj = original_open(*args, **kwargs)
+            opened.append(file_obj)
+            self.addCleanup(file_obj.close)
+            return file_obj
+
+        with mock.patch.object(sys, 'argv', [self.SCRIPT] + list(args)), \
+                mock.patch('builtins.open', side_effect=retain_file), \
+                redirect_stdout(io.StringIO()), redirect_stderr(io.StringIO()):
+            try:
+                return cli['resolve_files']()
+            finally:
+                self.assertTrue(opened)
+                self.assertTrue(all(file_obj.closed for file_obj in opened))
+
+    def test_closes_json_inputs(self):
+        self.assertTrue(self._run_with_retained_files(
+            '/a', os.path.join(self.dir, 'a.json'),
+            os.path.join(self.dir, 'b.json')))
+
+    def test_closes_pointer_file(self):
+        self.assertTrue(self._run_with_retained_files(
+            '-f', os.path.join(self.dir, 'ptr.txt'),
+            os.path.join(self.dir, 'a.json')))
+
+    def test_closes_invalid_pointer_file(self):
+        self._write('invalid-pointer.txt', 'missing-leading-slash')
+        with self.assertRaises(SystemExit) as caught:
+            self._run_with_retained_files(
+                '-f', os.path.join(self.dir, 'invalid-pointer.txt'),
+                os.path.join(self.dir, 'a.json'))
+        self.assertEqual(caught.exception.code, 2)
+
+    def test_closes_pointer_file_after_decoding_error(self):
+        path = os.path.join(self.dir, 'invalid-pointer.txt')
+        with open(path, 'wb') as f:
+            f.write(b'/\xff')
+        with self.assertRaises(SystemExit) as caught:
+            self._run_with_retained_files(
+                '-f', path, os.path.join(self.dir, 'a.json'))
+        self.assertEqual(caught.exception.code, 2)
+
+    def test_pointer_decoding_error_keeps_stdin_open(self):
+        cli = runpy.run_path(self.SCRIPT)
+        stdin = io.TextIOWrapper(io.BytesIO(b'/\xff'), encoding='utf-8')
+        self.addCleanup(stdin.close)
+        args = [self.SCRIPT, '-f', '-', os.path.join(self.dir, 'a.json')]
+        with mock.patch.object(sys, 'argv', args), \
+                mock.patch.object(sys, 'stdin', stdin), \
+                mock.patch('builtins.open') as open_file, \
+                redirect_stderr(io.StringIO()):
+            with self.assertRaises(SystemExit) as caught:
+                cli['resolve_files']()
+            self.assertEqual(caught.exception.code, 2)
+            open_file.assert_not_called()
+        self.assertFalse(stdin.closed)
+
+    def test_closes_inputs_after_json_errors(self):
+        self._write('invalid.json', '{"a": }')
+        with self.assertRaises(json.JSONDecodeError):
+            self._run_with_retained_files('/a', os.path.join(self.dir, 
'invalid.json'))
+        self.assertFalse(self._run_with_retained_files(
+            '--continue-on-error', '/a', os.path.join(self.dir, 
'invalid.json'),
+            os.path.join(self.dir, 'a.json')))
+
+    def test_keeps_stdin_open(self):
+        cli = runpy.run_path(self.SCRIPT)
+        for args, content in ((['/a', '-'], '{"a": 1}'),
+                              (['-f', '-', os.path.join(self.dir, 'a.json')], 
'/a\n')):
+            with self.subTest(args=args):
+                stdin = io.StringIO(content)
+                self.addCleanup(stdin.close)
+                with mock.patch.object(sys, 'argv', [self.SCRIPT] + args), \
+                        mock.patch.object(sys, 'stdin', stdin), \
+                        redirect_stdout(io.StringIO()):
+                    self.assertTrue(cli['resolve_files']())
+                self.assertFalse(stdin.closed)
+
+    def test_keyboard_interrupt_exit_status(self):
+        cli = runpy.run_path(self.SCRIPT)
+        args = [self.SCRIPT, '/a', os.path.join(self.dir, 'a.json')]
+        with mock.patch.object(sys, 'argv', args), \
+                mock.patch('json.load', side_effect=KeyboardInterrupt):
+            with self.assertRaises(SystemExit) as caught:
+                cli['main']()
+        self.assertEqual(caught.exception.code, 130)
+
     def test_utf8_json_file_without_utf8_mode(self):
         self._write('unicode.json', '{"value": "🚀"}')
         proc = self._run('/value', 'unicode.json', utf8=False)
@@ -648,6 +848,19 @@
         self.assertEqual(proc.returncode, 2)
         self.assertIn("invalid JSON pointer 'a'", proc.stderr)
 
+    def test_invalid_pointer_file_encoding(self):
+        with open(os.path.join(self.dir, 'bad.txt'), 'wb') as f:
+            f.write(b'/\xff')
+        for options in ([], ['--continue-on-error']):
+            with self.subTest(options=options):
+                proc = self._run(*options, '-f', 'bad.txt',
+                                 'a.json', 'b.json')
+                self.assertEqual(proc.returncode, 2, proc.stderr)
+                self.assertEqual(proc.stdout, '')
+                self.assertIn('could not decode pointer file:', proc.stderr)
+                self.assertIn('decode', proc.stderr)
+                self.assertNotIn('Traceback', proc.stderr)
+
     def test_empty_pointer(self):
         proc = self._run('', 'a.json')
         self.assertEqual(proc.returncode, 0, proc.stderr)
@@ -783,6 +996,12 @@
         self.assertEqual(proc.stdout, self.A_OUT)
         self.assertIn('missing.json', proc.stderr)
 
+    def test_missing_pointer_file(self):
+        proc = self._run('-f', 'missing.txt', 'a.json')
+        self.assertEqual(proc.returncode, 2)
+        self.assertEqual(proc.stdout, '')
+        self.assertIn("can't open 'missing.txt'", proc.stderr)
+
     def test_pointer_file_requires_value(self):
         proc = self._run('-f', '-p', '/a', 'a.json')
         self.assertEqual(proc.returncode, 2)
@@ -823,6 +1042,67 @@
             self.assertIn('bar', str(e))
 
 
+class DocExampleTests(unittest.TestCase):
+    """ Runs the shell examples from the documentation """
+
+    ROOT = os.path.dirname(os.path.abspath(__file__))
+    SCRIPT = os.path.join(ROOT, 'bin', 'jsonpointer')
+
+    def _examples(self, name):
+        """ Yields (command, expected output) pairs of the shell sessions in
+        the ``code-block:: bash`` directives of the given doc file """
+        with open(os.path.join(self.ROOT, 'doc', name), encoding='utf-8') as f:
+            blocks = f.read().split('.. code-block:: bash\n')[1:]
+        self.assertTrue(blocks, 'no bash examples found in ' + name)
+
+        for block in blocks:
+            # The block ends at the first non-indented line
+            lines = []
+            for line in block.splitlines()[1:]:
+                if line and not line[0].isspace():
+                    break
+                lines.append(line)
+            lines = textwrap.dedent('\n'.join(lines)).splitlines()
+
+            cmd, output = None, []
+            for line in lines + ['']:
+                is_output = line.strip() and not line.startswith(('$ ', '#'))
+                if cmd is not None and is_output:
+                    output.append(line)
+                    continue
+                if cmd is not None:
+                    yield cmd, ''.join(out + '\n' for out in output)
+                cmd, output = None, []
+                if line.startswith('$ '):
+                    cmd = line[2:]
+
+    def test_commandline_examples(self):
+        tmpdir = tempfile.TemporaryDirectory()
+        self.addCleanup(tmpdir.cleanup)
+        env = dict(os.environ, PYTHONPATH=self.ROOT, PYTHONUTF8='1')
+
+        examples = list(self._examples('commandline.rst'))
+        self.assertTrue(any(cmd.startswith('jsonpointer ')
+                            for cmd, _ in examples))
+        for cmd, expected in examples:
+            with self.subTest(cmd=cmd):
+                args = shlex.split(cmd)
+                if args[0] == 'cat':
+                    # "cat" shows the input files used by later examples
+                    path = os.path.join(tmpdir.name, args[1])
+                    with open(path, 'w', encoding='utf-8') as f:
+                        f.write(expected)
+                    continue
+
+                self.assertEqual(args[0], 'jsonpointer')
+                result = subprocess.run([sys.executable, self.SCRIPT] + 
args[1:],
+                                        cwd=tmpdir.name, env=env,
+                                        capture_output=True, encoding='utf-8')
+                self.assertEqual(result.returncode, 0, result.stderr)
+                self.assertEqual(result.stdout, expected)
+
+
 def load_tests(loader, tests, ignore):
     tests.addTests(doctest.DocTestSuite(jsonpointer))
+    tests.addTests(doctest.DocFileSuite('doc/tutorial.rst'))
     return tests

Reply via email to