diff options
Diffstat (limited to 'dev-python/httpx')
-rw-r--r-- | dev-python/httpx/Manifest | 3 | ||||
-rw-r--r-- | dev-python/httpx/files/httpx-0.18.2-big-endian.patch | 40 | ||||
-rw-r--r-- | dev-python/httpx/httpx-0.18.2.ebuild | 9 |
3 files changed, 49 insertions, 3 deletions
diff --git a/dev-python/httpx/Manifest b/dev-python/httpx/Manifest index 62c5e9d8ecde..b3927a8e4e58 100644 --- a/dev-python/httpx/Manifest +++ b/dev-python/httpx/Manifest @@ -1,5 +1,6 @@ +AUX httpx-0.18.2-big-endian.patch 2009 BLAKE2B 889f4636c88029778fc7f56b6635543794de81c60b3ef704e577a62ef8d8a1d3eccd19c80c3f6a9870f6b6aca98f4e3692e5ac31be800c707ad5bf91d73b6ece SHA512 3cc62f6b5a039f1c7c79854a95991e750162419d9c5f21a8fdf4d009f19a0694c711bec4aba7cfcfe17c08d98e8fabbe2ab4531ea58a4f5050867cf4f440c836 DIST httpx-0.18.1.tar.gz 1663996 BLAKE2B dcbfcb4a452b47b643d5114a535005f7f92170392202dedc6c152546430231d20fd8b94b7ecc1d2abacbc9d76acb14cbfdc268109b171cc40812504e696dcaab SHA512 954b020d117dd1064262f3ac2d3137d01bba344b1a061e5713c3889283334d9ca92d9ed3d23f6ce79d684e31bae2d83fca6993178ef55e5a91353b812ad489e3 DIST httpx-0.18.2.tar.gz 1666756 BLAKE2B 3d1e25d503ae5306150c157bc83afdac9a475110d042e041b58de448a0dcfd75de3f4c15836b838dc799cd5f8b7e0d646e43bbe107ffad87d51ff016afe585cd SHA512 727974e5d5924fdd653987dd4f528d27bb2653085b01ef5efcdac39dc92ef2ed586f872c202349aa31105ad970cff914de4315c2d79338a6aa18bebb8126f392 EBUILD httpx-0.18.1.ebuild 1355 BLAKE2B 94a851f649d0dc4f8455fd08544f1a22f3f960df4d880368d63ae0ecb59384df465930c71b7078b7493d0e7dada421230dfb4303b6bc577330076e72418520ae SHA512 903129f1d0120d980981e60a0a185ceded491d6e00cfb457b02a069ef709c513a5c764817a1450ce3406c2f3fd0ef93960eaff1b8e412bcc56f3f2e9f309d036 -EBUILD httpx-0.18.2.ebuild 1593 BLAKE2B 674286b88f5d85114101b08a735a7e5a8c6a6f82b4c98c7ddf6dfa67632b6849573fcdd22e5e785b30b76d826297bbb05c0815d96937f8576eb94d2116acbaa1 SHA512 44960d18587f5444ce07650a233d388c5fe8dba07b49d941bd09f742ff18f0ee398887129efb607685dbfffe983f835f688101612808a7749ef31884fa4d6644 +EBUILD httpx-0.18.2.ebuild 1686 BLAKE2B 5c83b933800521aa1a1adf4a3bff9ec4fde481b84e2996b0f79d56bb44b26e88bd338bd6feb0c4546f0915dc7e484090a3a1fddc4efcf0db1d3b30ed3f573e23 SHA512 2434d6a19f8f7109e6b13af15d93fe06b16bf19e5e3a0ab2a4face3a67d09d4ee96dde5f7e51659a19e91734d5ba7080b0296d2e5268b42f5e678bd803a65609 MISC metadata.xml 444 BLAKE2B 62369fdf937f8caf46980620f2da0b16512ef94cbea9fecf0c336029a709e0975332d0d4e53ff4f3eeddeb9d231a5003dff9bbdf999846152bf578772b47d9a9 SHA512 bbbc7e622f0aae3b63e19765626ee13adf027d5ed98ca97fe04592b1f0a8da0cd0302b31f9cda90eaacf2bf5dad9c6472ddd795db75f0992ba4f084e4135ea3d diff --git a/dev-python/httpx/files/httpx-0.18.2-big-endian.patch b/dev-python/httpx/files/httpx-0.18.2-big-endian.patch new file mode 100644 index 000000000000..794609d86a50 --- /dev/null +++ b/dev-python/httpx/files/httpx-0.18.2-big-endian.patch @@ -0,0 +1,40 @@ +From 88a0a85ff795d8c23d5cd2cd113eeac957cc818a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Thu, 5 Aug 2021 17:35:54 +0200 +Subject: [PATCH] Fix JSON wrong encoding tests on big endian platforms + +Fix test_json_without_specified_encoding_*_error tests on big endian +platforms. The tests wrongly assume that data encoded as "utf-32-be" +can not be decoded as "utf-32". This is true on little endian platforms +but on big endian platforms "utf-32" is equivalent to "utf-32-be". +To avoid the problem, explicitly decode as "utf-32-le", as this should +trigger the expected exception independently of platform's endianness. +--- + tests/models/test_responses.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/models/test_responses.py b/tests/models/test_responses.py +index f1815dc..b7c2d57 100644 +--- a/tests/models/test_responses.py ++++ b/tests/models/test_responses.py +@@ -735,7 +735,7 @@ def test_json_without_specified_encoding_decode_error(): + content = json.dumps(data).encode("utf-32-be") + headers = {"Content-Type": "application/json"} + # force incorrect guess from `guess_json_utf` to trigger error +- with mock.patch("httpx._models.guess_json_utf", return_value="utf-32"): ++ with mock.patch("httpx._models.guess_json_utf", return_value="utf-32-le"): + response = httpx.Response( + 200, + content=content, +@@ -750,7 +750,7 @@ def test_json_without_specified_encoding_value_error(): + content = json.dumps(data).encode("utf-32-be") + headers = {"Content-Type": "application/json"} + # force incorrect guess from `guess_json_utf` to trigger error +- with mock.patch("httpx._models.guess_json_utf", return_value="utf-32"): ++ with mock.patch("httpx._models.guess_json_utf", return_value="utf-32-le"): + response = httpx.Response(200, content=content, headers=headers) + with pytest.raises(json.decoder.JSONDecodeError): + response.json() +-- +2.32.0 + diff --git a/dev-python/httpx/httpx-0.18.2.ebuild b/dev-python/httpx/httpx-0.18.2.ebuild index dc1258768a98..4f44b01f6d45 100644 --- a/dev-python/httpx/httpx-0.18.2.ebuild +++ b/dev-python/httpx/httpx-0.18.2.ebuild @@ -7,7 +7,7 @@ EAPI=7 # DOCS_BUILDER="mkdocs" # DOCS_DEPEND="dev-python/mkdocs-material" # DOCS_AUTODOC=1 -PYTHON_COMPAT=( python3_{8..9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 # docs @@ -17,7 +17,7 @@ SRC_URI="https://github.com/encode/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" LICENSE="BSD" SLOT="0" -KEYWORDS="amd64 arm ~arm64 ~ppc ~ppc64 ~sparc x86" +KEYWORDS="amd64 arm arm64 ppc ~ppc64 sparc x86" RDEPEND=" dev-python/certifi[${PYTHON_USEDEP}] @@ -40,6 +40,11 @@ BDEPEND=" distutils_enable_tests pytest +PATCHES=( + # https://github.com/encode/httpx/pull/1781 + "${FILESDIR}"/${P}-big-endian.patch +) + python_prepare_all() { # trio is not currently in the tree sed -i '/^import trio/d' tests/concurrency.py || die |