]> granicus.if.org Git - python/commit
bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a bad...
authorOren Milman <orenmn@gmail.com>
Fri, 29 Sep 2017 18:34:31 +0000 (21:34 +0300)
committerBrett Cannon <brettcannon@users.noreply.github.com>
Fri, 29 Sep 2017 18:34:31 +0000 (11:34 -0700)
commit01c6a8859ef2ff5545a87cf537573bd342c848bf
tree67a72ecdad511b4890802ea8c12494f2e3888a58
parent66033733aa032707b57cf1b0e8d5a1c5e4afceb9
bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a bad zlib.decompress() (GH-3784)

While a rare potential failure (it requires swapping out zlib.decompress() itself and forcing it to return a non-bytes object), this change prevents a potential C-level assertion failure and instead substitutes it with an exception.

Thanks to Oren Milman for the patch.
Lib/test/test_zipimport.py
Misc/NEWS.d/next/Core and Builtins/2017-09-27-09-30-03.bpo-31602.MtgLCn.rst [new file with mode: 0644]
Modules/zipimport.c