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
Most commands in the bin directory, added in #990, will work on Windows if we create .bat variants. For example if we create a bin/flake8.bat that does the same thing in Windows-land as bin/flake8, then someone in Windows-land can type bin\flake8 to start flake8.
However, when a file with an extension is called as a command in Windows' standard command interpreter, cmd.exe, doesn't search for anything with a .bat extension; instead, it opens the file using the application associated with that extension. This means, for instance, that typing bin\manage.py will either try opening that file with the user's Python interpreter (if they have Python installed), or open an annoying dialog asking what they want the user to do with manage.py (if the user doesn't have Python installed). Either way, the wrong thing happens on Windows.
One solution is to make Windows users always add .bat to the end of the command, but this extra work is cumbersome, and forgetting to add it results in something very confusing happening. So instead, I think it might be better to simply rename such commands to not have extensions:
bin/py.test can be renamed to bin/pytest. This is actually something py.test does anyways (it makes its main script available at both py.testandpytest) so I think it should still be in keeping with convention.
bin/manage.py is a bit more challenging, since there aren't other conventional names for that script. I think bin/manage or bin/managepy could work OK.
The text was updated successfully, but these errors were encountered:
Most commands in the
bin
directory, added in #990, will work on Windows if we create.bat
variants. For example if we create abin/flake8.bat
that does the same thing in Windows-land asbin/flake8
, then someone in Windows-land can typebin\flake8
to startflake8
.However, when a file with an extension is called as a command in Windows' standard command interpreter,
cmd.exe
, doesn't search for anything with a.bat
extension; instead, it opens the file using the application associated with that extension. This means, for instance, that typingbin\manage.py
will either try opening that file with the user's Python interpreter (if they have Python installed), or open an annoying dialog asking what they want the user to do withmanage.py
(if the user doesn't have Python installed). Either way, the wrong thing happens on Windows.One solution is to make Windows users always add
.bat
to the end of the command, but this extra work is cumbersome, and forgetting to add it results in something very confusing happening. So instead, I think it might be better to simply rename such commands to not have extensions:bin/py.test
can be renamed tobin/pytest
. This is actually something py.test does anyways (it makes its main script available at bothpy.test
andpytest
) so I think it should still be in keeping with convention.bin/manage.py
is a bit more challenging, since there aren't other conventional names for that script. I thinkbin/manage
orbin/managepy
could work OK.The text was updated successfully, but these errors were encountered: