diff options
author | Thomas Grainger <tagrain@gmail.com> | 2022-07-17 02:07:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-16 18:07:53 -0700 |
commit | 6da988a46c8955755624ad9878288d5214fceb4e (patch) | |
tree | bc3d48d836bb49b52f76761f776ec8c0440793a2 /Lib/zipimport.py | |
parent | 2e9da8e3522764d09f1d6054a2be567e91a30812 (diff) | |
download | cpython-6da988a46c8955755624ad9878288d5214fceb4e.tar.gz cpython-6da988a46c8955755624ad9878288d5214fceb4e.zip |
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>
Diffstat (limited to 'Lib/zipimport.py')
-rw-r--r-- | Lib/zipimport.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/zipimport.py b/Lib/zipimport.py index d0394107c2c..016f1b8a797 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -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: |