This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author graingert
Recipients graingert
Date 2022-03-15.10:32:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
importing a module with bytes in `sys.path` fails with:

  File "<frozen importlib._bootstrap_external>", line 182, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

(see reproducer in attached

however `sys.path` is documented as supporting bytes "Only strings and bytes should be added to sys.path; all other data types are ignored during import."

bytes are allowed in PathFinder._find_spec but perhaps they should be ignored or explicitly fsdecoded ? 

see also:
Date User Action Args
2022-03-15 10:32:43graingertsetrecipients: + graingert
2022-03-15 10:32:43graingertsetmessageid: <>
2022-03-15 10:32:43graingertlinkissue47025 messages
2022-03-15 10:32:43graingertcreate