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
[BUG] stderr duplication failed #10444
Comments
The reason you're seeing this error only in the selected environments (non-editable install) is because only editable installs use Setuptools' launcher scripts. The error you're getting is from the launcher scripts installed by pip and distlib. You'll want to report the issue to the distlib project and see that pip inherits the fix. For that reason, I'll move this issue to pip and I recommend you to file an issue with distlib. |
@rayzchen Is this still happening? Could you provide some information of the pip version you are using? |
It still happens with pip version 21.2.4 |
cc @vsajip since the launchers are from distlib. |
I can't reproduce this - it might be something specific in @rayzchen 's environment. I'm using Python 3.9.7 on Windows 10.
And no error dialog box comes up. If I additionally install
and reinstall using |
I tried the exact same thing that you did and I still got the error. What does the error actually mean? I'm using python 3.9.4, and I upgraded setuptools to 57.0.0. |
|
It means that the Windows DuplicateHandle API failed (returned an error) for the
I have no way of telling if that's the case in your environment, of course. What Windows version is it where the failure occurs? That might be relevant. |
Can you please confirm that it's running on a 64-bit processor? Can you please try with a 64-bit Python? Your version string seems to indicate a 32-bit Python. |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
This was reported at msys2/MSYS2-packages#2694. Your handles.py script returns 1 1 1 when run via python, but if I modify the script to use MessageBoxW instead of print, and run via pythonw instead, I got 0 0 0. Outputting the handle values, input and output are 0, and only error is an actual handle. def MessageBox(message):
return windll.user32.MessageBoxW(0, str(message), "Your title", 1) The last error from DuplicateHandle is 6 (ERROR_INVALID_HANDLE) for in and out, and 50 (ERROR_NOT_SUPPORTED) for error. |
When run from cmd.exe, all 3 handles are 0, and all 3 DuplicateHandle calls error with ERROR_INVALID_HANDLE) |
Not sure exactly what you mean by "run from cmd.exe" - I originally ran the |
Sorry. The report to MSYS2 was that they got this error from a GUI launcher when launched from Git for Windows Bash but not when launched from cmd or powershell. I was testing using MSYS2 (Git for Windows uses a fork of MSYS2, and in turn MSYS2 is a fork of Cygwin). |
So you're saying it only happens on MSYS and consequently on git bash?
|
Any reason you can't download the built launchers in the distlib repo https://github.com/pypa/distlib/raw/master/distlib/{t32,t64,w32,w64}.exe and test with those? Just to ensure that what gets into the next distlib release is fit for purpose. |
I forgot that the binaries are contained in the repo - thanks. |
I confirm that the |
If this helps, the error happens with |
@rayzchen Just to be clear - are you saying this error still occurs with the latest launchers patched into |
It's my current setup which shouldn't have been modified since I opened this issue, which I guess isn't much help anymore. How do I get the new launcher? |
You clone the distlib repository and look for the |
I tested the latest pip together with the updated binaries from the latest distlib. I can confirm this works with cli with both; msys2 as well as with the Windows cmd prompt. |
Not sure if we already upgraded distlib in 22.1, adding this to the milestone just to be sure. |
The distlib changes haven't been released. #11063 did not update to distlib 0.3.4 since that was the problematic version. Once there's a new distlib release containing the fixed launchers, we can update the vendored distlib. :) |
Just waiting for a response from @rayzchen (and anyone else) and then I should be able to cut a release soon after that. |
Didn't hear from @rayzchen, but |
@sbidoul FYI: when you do the vendoring update, this issue should be closed. |
Sorry for the late reply, but which one do I download, |
I tried both but I get |
You can't just run the launchers, if that's what you tried. What did you actually do with the launchers? |
Double click it, I guess? |
Ok. I'll be glad if anyone is able to provide a changelog entry for this issue, though. |
No, that just runs the launcher by itself, which would fail in the way you saw. What needs to be done is for the executables from the latest |
Ah, got it. The new executables work now, I don't get the error. Just out of curiosity, how do I use the executables to create scripts? Is it something like running
like using 7z.sfx? |
Well, the easiest way is to use |
setuptools version
setuptools==56.0.0
Python version
Python 3.9
OS
Windows
Additional environment information
No response
Description
I use
gui_scripts
with a blank function. If i usepip install -e .
orpy setup.py install
nothing happens, as expected. If i dopip install .
or use setup.py to make a binary dist then install it, i getstderr duplication failed
in a prompt. This happens before any code gets run.Expected behavior
Nothing
How to Reproduce
Run above commands
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: