mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-91181: drop support for bytes on sys.path (GH-31934)
Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it. Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
2e9da8e352
commit
6da988a46c
6 changed files with 8 additions and 9 deletions
|
@ -63,8 +63,7 @@ class zipimporter(_bootstrap_external._LoaderBasics):
|
|||
# if found, or else read it from the archive.
|
||||
def __init__(self, path):
|
||||
if not isinstance(path, str):
|
||||
import os
|
||||
path = os.fsdecode(path)
|
||||
raise TypeError(f"expected str, not {type(path)!r}")
|
||||
if not path:
|
||||
raise ZipImportError('archive path is empty', path=path)
|
||||
if alt_path_sep:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue