Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-118234: Avoid socket failure with missing SYSTEMROOT env var on Windows#134363
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Resolvespython#118234 by checking for the SystemRoot environment variableand, if it is missing, setting it based on GetWindowsDirectoryW.As described in the issue, the default path of the provider DLL isstored in the registry as "%SystemRoot%\System32\mswsock.dll" which doesnot resolve without SystemRoot set (typically to "C:\Windows").
I don't think that it's a good idea to set cc@zooba |
Yeah, I don't love this, and certainly not as part of socketmodule. It might make sense in python.c, to detect whenever someone launches Python with an empty environment, but it's probably even better in subprocess to warn peoplebefore they launch with an empty environment. In my experience, this only ever happens when launching from Python. I've not seen any other language cause it.This list linked in the bug has the main ones, and we should probably just ensure that subprocess always sets them if the caller omits them. |
Sentgh-134435 instead. |
Uh oh!
There was an error while loading.Please reload this page.
Resolves#118234 by checking for the SystemRoot environment variable and, if it is missing, setting it based on
GetWindowsDirectoryW
.As described in the issue, the default path of the provider DLL is stored in the registry as "%SystemRoot%\System32\mswsock.dll" which does not resolve without SystemRoot set (typically to "C:\Windows").