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 eric.smith
Recipients eric.smith, graingert
Date 2022-03-15.11:03:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647342217.51.0.13879680728.issue47025@roundup.psfhosted.org>
In-reply-to
Content
In case it helps anyone:

On Windows 3.11.0a5+ the full traceback is:

$ ./python.bat demo.py
Running Debug|x64 interpreter...
Traceback (most recent call last):
  File "...\demo.py", line 23, in <module>
    sys.exit(main())
             ^^^^^^
  File "...\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\demo.py", line 11, in _tmp_path
    yield pathlib.Path(tmp_dir)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\demo.py", line 18, in main
    import module
    ^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1080, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1487, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1459, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1596, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1656, in _fill_cache
TypeError: a bytes-like object is required, not 'str'

And on cygwin 3.8.12:

$ python demo.py
Traceback (most recent call last):
  File "<frozen importlib._bootstrap_external>", line 1346, in _path_importer_cache
KeyError: b'/tmp/tmprpymgive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 23, in <module>
    sys.exit(main())
  File "demo.py", line 18, in main
    import module
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 914, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1407, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1376, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1348, in _path_importer_cache
  File "<frozen importlib._bootstrap_external>", line 1324, in _path_hooks
  File "<frozen importlib._bootstrap_external>", line 1594, in path_hook_for_FileFinder
  File "<frozen importlib._bootstrap_external>", line 1469, in __init__
  File "<frozen importlib._bootstrap_external>", line 177, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
History
Date User Action Args
2022-03-15 11:03:37eric.smithsetrecipients: + eric.smith, graingert
2022-03-15 11:03:37eric.smithsetmessageid: <1647342217.51.0.13879680728.issue47025@roundup.psfhosted.org>
2022-03-15 11:03:37eric.smithlinkissue47025 messages
2022-03-15 11:03:37eric.smithcreate