mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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>
(cherry picked from commit 6da988a46c
)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
parent
e121cb5814
commit
ccbf85382c
6 changed files with 8 additions and 9 deletions
|
@ -1468,7 +1468,7 @@ class PathFinder:
|
|||
# the list of paths that will become its __path__
|
||||
namespace_path = []
|
||||
for entry in path:
|
||||
if not isinstance(entry, (str, bytes)):
|
||||
if not isinstance(entry, str):
|
||||
continue
|
||||
finder = cls._path_importer_cache(entry)
|
||||
if finder is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue