From 6ea34a4435fa549ea14c37b937d17af607afd6d4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 10 Mar 2024 12:09:13 +0000 Subject: Update to jq 1.7.1 --- CHANGELOG.rst | 2 ++ README.rst | 4 ++-- deps/jq-1.7.1.tar.gz | Bin 0 -> 1950645 bytes deps/jq-1.7.tar.gz | Bin 1905863 -> 0 bytes setup.py | 4 ++-- tests/jq_tests.py | 16 +++++++++++++--- 6 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 deps/jq-1.7.1.tar.gz delete mode 100644 deps/jq-1.7.tar.gz diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8a30a3f..1e14bde 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,8 @@ Changelog 1.7.0 ----- +* Update to jq 1.7.1. + * Include tox.ini in sdist. * Use the version of oniguruma distributed with jq. diff --git a/README.rst b/README.rst index 9e90d73..d1a4210 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ jq.py: a lightweight and flexible JSON processor ================================================ This project contains Python bindings for -`jq `_ 1.7. +`jq `_ 1.7.1. Installation ------------ @@ -15,7 +15,7 @@ On these platforms, you should be able to install jq with a normal pip install: pip install jq If a wheel is not available, -the source for jq 1.7 is built. +the source for jq 1.7.1 is built. This requires: * Autoreconf diff --git a/deps/jq-1.7.1.tar.gz b/deps/jq-1.7.1.tar.gz new file mode 100644 index 0000000..40718ba Binary files /dev/null and b/deps/jq-1.7.1.tar.gz differ diff --git a/deps/jq-1.7.tar.gz b/deps/jq-1.7.tar.gz deleted file mode 100644 index 07e6d39..0000000 Binary files a/deps/jq-1.7.tar.gz and /dev/null differ diff --git a/setup.py b/setup.py index 73f8b94..de0b635 100644 --- a/setup.py +++ b/setup.py @@ -24,8 +24,8 @@ def _read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -jq_lib_tarball_path = _dep_source_path("jq-1.7.tar.gz") -jq_lib_dir = _dep_build_path("jq-1.7") +jq_lib_tarball_path = _dep_source_path("jq-1.7.1.tar.gz") +jq_lib_dir = _dep_build_path("jq-1.7.1") class jq_with_deps_build_ext(build_ext): def run(self): diff --git a/tests/jq_tests.py b/tests/jq_tests.py index c911ef5..62b3ae0 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -319,9 +319,19 @@ class TestJvToPython(object): def test_given_json_text_then_strings_containing_null_characters_are_preserved(self): program = jq.compile(".") - result = program.input(text='"a\x00b"').first() - - assert_equal("a\x00b", result) + # Before jq 1.7.1, we expect jq to accept the literal null character. + # From jq 1.7.1, we expect jq to reject the literal null character. + + try: + result = program.input(text='"a\x00b"').first() + + assert_equal("a\x00b", result) + except ValueError as error: + assert_equal( + "parse error: Invalid string: control characters from U+0000 " + + "through U+001F must be escaped at line 1, column 5", + str(error), + ) def test_program_preserves_arrays(self): program = jq.compile(".") -- cgit v1.2.3