You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sys.path change breaks editable installs of cwd #12956
The new sys.path logic introduced in #11143 carefully avoids putting cwd onto sys.path, which is probably generally a good thing. However, the logic incorrectly removes cwd from sys.path in cases where the current directory has been editably installed (i.e. is on sys.path for reasons unrelated to being the current directory).
I'm not the most familiar with the code, but my understanding is this often doesn't really matter, since cwd should be on search_paths.python_path. However, it looks like we only look for stub packages on search_paths.package_path (which is where cwd is now removed from).
My concern here isn't theoretical. It came up in #12931 where when trying to reproduce, stubtest was unable to find the django stubs.
Depending on how serious we feel this concern is / how strictly backward compatible we want to be, there are several options for working around this. Curious for your opinions!
I think the best thing to do is search for stub packages in the python path as well. We've had requests for this in the past, and with #8545 any extra packages can be disabled if need be.
(Also from a consistency standpoint this would be simpler)
Activity
emmatyping commentedon Jun 8, 2022
I think the best thing to do is search for stub packages in the python path as well. We've had requests for this in the past, and with #8545 any extra packages can be disabled if need be.
(Also from a consistency standpoint this would be simpler)
Handle cwd correctly in pyinfo
Handle cwd correctly in pyinfo
Handle cwd correctly in pyinfo (#13161)
Handle cwd correctly in pyinfo (python#13161)
Handle cwd correctly in pyinfo (#13161) (#13162)