mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
This commit is contained in:
parent
e788057a91
commit
b82e17e626
70 changed files with 3565 additions and 1816 deletions
|
@ -351,7 +351,7 @@ def _get_module_info(self, fullname):
|
|||
# data_size and file_offset are 0.
|
||||
def _read_directory(archive):
|
||||
try:
|
||||
fp = _io.open(archive, 'rb')
|
||||
fp = _io.open_code(archive)
|
||||
except OSError:
|
||||
raise ZipImportError(f"can't open Zip file: {archive!r}", path=archive)
|
||||
|
||||
|
@ -533,7 +533,7 @@ def _get_data(archive, toc_entry):
|
|||
if data_size < 0:
|
||||
raise ZipImportError('negative data size')
|
||||
|
||||
with _io.open(archive, 'rb') as fp:
|
||||
with _io.open_code(archive) as fp:
|
||||
# Check to make sure the local file header is correct
|
||||
try:
|
||||
fp.seek(file_offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue