-
-
Notifications
You must be signed in to change notification settings - Fork 530
Shell commands fail on Windows due to popen shell=False in Action._popen #257
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
Comments
Original comment by @hpk42 i guess you need to look at the venv.py and tests/test_venv.py in particular. First writing a test that fails is the hard bit, maybe. |
Original comment by @stefano-m @hpk42 I might have some time to work on this, would you mind to give me pointers to the parts of tox's code I should look at and where I should put the tests? Thanks. |
Original comment by @stefano-m Reopening to keep this visible. |
Original comment by @stefano-m @The-Compiler, I've verified that on Windows, if |
Original comment by @stefano-m A quick update. This is an excerpt from my
Of course, if |
Original comment by @stefano-m Ahh! I did not know that! In fact, I was thinking about why In that case, it might be great if tox could be enhanced to do that too. Still, I feel that the specific issue that I opened is still "invalid". Should we open a new one with a clearer title and goal? Or would it be OK to reopen this one instead? Thanks. |
Original comment by @hpk42 Wait a second -- tox does have machinery to find the correct .cmd/.bat etc. files if a command is on PATH (so e.g. "npm" could actually be "npm.exe" or "npm.cmd" and your tox.ini would work). |
Original comment by @stefano-m Not an issue, see discussion for details. Maybe some documentation can be added to avoid confusion to Windows users. |
Original comment by @stefano-m Hi, I've just tried to run the Oh well, I guess that we can discard my pull request and I will modify my Would it be worth adding something to the documentation about this? Thank you very much for your super-fast feedback! |
Original comment by @The-Compiler I guess Have you tried actually invoking |
Original comment by @hpk42 i also don't understand why shell is needed for gulp. At this point i don't think we want to change the invocation semantics without very clear reasons and probably even then only by a per-testenv switch or so. |
Original comment by @stefano-m
So, for Windows,
Honestly, I don't know why subprocess fails on Windows if |
Original comment by @stefano-m I have created pull request #165 that attempts to address the issue. This is my first PR, so please excuse me if I have done something wrong with the various procedures etc. Thanks. |
Original comment by @The-Compiler What kind of file is |
@stefano-m As the PR was declined on bitbucket and the general opinion seems to be against changing the invocation semantics I'll close this. Feel free to reopen if you want to have another go at tackling this. |
@obestwalter thanks for your comment. I agree with you on this and think that it's better to leave the code as is. |
When running tox on Windows on GitHub Actions, I inconsistently get the Issue tracked here: open-contracting/standard-maintenance-scripts#149 |
Hello,
I am using tox 2.0.2 and Python 2.7 on Windows 7.
As part of my tox tests, I need to run gulp and other npm-related commands.
To do so, I first run npm install and then e.g. run gulp that has been installed in the node_modules directory.
The relevant part of my tox.ini looks like
When I run tox, I get the following error when gulp is run:
The same configuration works OK on Linux.
I think that the problem lies in
Action._popen
in thesession.py
module, whereself.session.popen
is called (line 216).popen is run with the
shell
keyword argument set toFalse
, and causes the command to fall over on Windows.Since I had already noticed that problem (on Windows only) in other places where I use
subprocess
, I tried to change the value toTrue
by doingand that solved the issue (while keeping the default value to
False
on non-Windows platforms).The text was updated successfully, but these errors were encountered: