[issue31143] lib2to3 requires source files for fixes

2021-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> wont fix stage: -> resolved status: open -> closed superseder: -> Close 2to3 issues and list them here ___ Python tracker ___

[issue31143] lib2to3 requires source files for fixes

2017-08-11 Thread Steve Dower
Steve Dower added the comment: Perhaps the more important question is whether 2to3 really needs to dynamically generate a list of fixers or if that should have been stopped due to YAGNI. There are only a few modules in the stdlib, and it doesn't seem to support proper namespace packages, so

[issue31143] lib2to3 requires source files for fixes

2017-08-11 Thread Brett Cannon
Brett Cannon added the comment: You're technically right, Verdan, but pkgutils is kind of a hack as it isn't always using standard APIs to achieve its goals, so I personally never recommend using the module unless absolutely necessary and you know exactly how brittle it can be. --

[issue31143] lib2to3 requires source files for fixes

2017-08-10 Thread Vedran Čačić
Vedran Čačić added the comment: I'm sorry about entering the discussion without knowing any connection between the original problem and Brett's question, but isn't the latter answered by pkgutil.iter_modules (and pkgutil.walk_packages if needed)? -- nosy: +veky

[issue31143] lib2to3 requires source files for fixes

2017-08-10 Thread Brett Cannon
Brett Cannon added the comment: Simplest way is to do https://docs.python.org/3/library/importlib.html#importlib.util.find_spec and see if a spec can be found for the module in question. That will do the search for the module but it won't load it. This does dictate that you know the name of

[issue31143] lib2to3 requires source files for fixes

2017-08-10 Thread Steve Dower
Steve Dower added the comment: It also breaks .zip file distribution, which I'm fairly sure we do explicitly support by virtue of having "python36.zip" in sys.path by default. And the ".pyc-only in a zip file" distribution is *totally* busted :) (and also officially released for Windows...)

[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread R. David Murray
R. David Murray added the comment: Ah, I see. We don't really support .pyc-only distribution, though we try not to break it. Do you want to propose a fix? -- ___ Python tracker

[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread Todd Schiller
Todd Schiller added the comment: I'm reporting that lib2to3 doesn't work without having source .py files for the fixes that are packaged with the lib2to3 library. Perhaps the get_all_fix_names method in lib2to3/refactor.py should check for either .py or .pyc files? The source files are

[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread R. David Murray
R. David Murray added the comment: What are you reporting as the bug here? 2to3 obviously can't work without the source, so based just on what you have written here this sounds like an Azure bug. -- nosy: +r.david.murray ___ Python tracker

[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread Todd Schiller
New submission from Todd Schiller: The lib2to3 library doesn't detect/apply any fixes if the source files aren't included with the distribution. See get_all_fix_names at https://github.com/python/cpython/blob/master/Lib/lib2to3/refactor.py#L30 This affects Azure's official Python site