-
Notifications
You must be signed in to change notification settings - Fork 33
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
[WinError 122] The data area passed to a system call is too small. #8
Comments
Without looking into it too deeply, this is likely caused by a very long file path. Do you have long paths enabled? Can you think of a possible candidate executable that has a very long path in your system? That would help explain the phenomenom. (This is more a note to self) I think it would likely be sufficient if we just ignore that entry and keep looking. It is highly unlikely the offending process is the shell we are looking for anyway—and we can always deal with it if someone ever needs to detect that process. |
If you want to try whether my guess is correct right now, modify def Process32Next(hSnapshot, pe=None):
if pe is None:
pe = PROCESSENTRY32()
pe.dwSize = sizeof(PROCESSENTRY32)
success = windll.kernel32.Process32Next(hSnapshot, byref(pe))
if not success:
if windll.kernel32.GetLastError() == ERROR_NO_MORE_FILES:
return
if windll.kernel32.GetLastError() == 122: # ERROR_INSUFFICIENT_BUFFER.
return pe # If this does not work, try "return".
raise WinError()
return pe and see if that works. |
Seems likely to work ok at a glance, and a good safety measure to build in anyway |
Thanks for taking a look! Unfortunately, I might not have a moment to give it a try until next week. |
No hurry, this is not pressing at the moment :) |
I edited Process32Next as instructed and success!!!
|
In addition, this was related to attempting to using pipenv shell and having the WinError. Making this same correction in the shellingham used in Pipenv resolved the problem. I suppose Pipenv should be advised to include this correction as well if it passes. Glad to help any anyway, but don't want to overstep. Before change to .\pipenv\vendor\shellingham\nt.py Process32Next:
After change to .\pipenv\vendor\shellingham\nt.py Process32Next:
Ryan |
We maintain pipenv also (this code was written for pipenv and most of the tooling in this organization is for pipenv) so this will land in the next release |
Hello,
I seem to be running into an issue with Windows 10. In the below example, I'm using ipython in the standard Windows Command Prompt. I am not sure if this is relevant, but I am using a corporate computer, where running applications in administrative is disable. I would be glad to provide additional details.
The text was updated successfully, but these errors were encountered: