Skip to content

gh-91181: restore support for bytes on sys.path in FileFinder #31897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Mar 15, 2022

@graingert graingert force-pushed the support-bytes-on-sys-path branch from 68b32ed to 6e553d8 Compare March 15, 2022 11:39
@graingert graingert force-pushed the support-bytes-on-sys-path branch from 6e553d8 to c1ee86e Compare March 15, 2022 11:45
@graingert graingert changed the title bpo-47025: support bytes on sys.path bpo-47025: restore support for bytes on sys.path in FileFinder Mar 15, 2022
path=new_path,
path_importer_cache=new_path_importer_cache,
path_hooks=new_path_hooks):
module = self.importlib.import_module('email')
Copy link
Contributor Author

@graingert graingert Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this results in a BytesWarning: Comparison between bytes and string when bytes are added to the sys.path_importer_cache this is an existing problem for zipimport paths https://bugs.python.org/issue47026

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that's causing CI to fail as BytesWarning is considered an error. Looks like I need to go to python-dev and ask what people want to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://discuss.python.org/t/drop-supporting-bytes-on-sys-path/17225

I'm now suggesting dropping bytes support in sys.path. We will see how that conversation goes.

@graingert graingert marked this pull request as ready for review March 15, 2022 13:36
@brettcannon brettcannon self-requested a review June 24, 2022 20:23
@brettcannon brettcannon changed the title bpo-47025: restore support for bytes on sys.path in FileFinder gh-91181: restore support for bytes on sys.path in FileFinder Jun 24, 2022
@brettcannon brettcannon linked an issue Jun 24, 2022 that may be closed by this pull request
@graingert graingert mannequin mentioned this pull request Jun 24, 2022
@brettcannon brettcannon self-assigned this Jul 8, 2022
@brettcannon brettcannon added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Jul 8, 2022
@graingert
Copy link
Contributor Author

Closing in favor of #31934

@graingert graingert closed this Jul 12, 2022
@graingert graingert deleted the support-bytes-on-sys-path branch July 12, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bytes do not work on sys.path
4 participants