entire admin_scripts test suite fails on Windows if sys.executable path has a space in it.
|Reported by:||Gabriel Hurley||Owned by:||Gabriel Hurley|
|Component:||Core (Management commands)||Version:||1.1|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This is an edge case to be sure, but it sure is annoying if you have Python installed somewhere funny...
If you have Python installed on Windows to a location like "C:\Program Files\python2.6\" then every test in regressiontests.admin_scripts will fail. This is due to the (known) poor escaping done by
Simply quoting the sys.executable path isn't enough, because if
finds a quote at the beginning of
, it strips that quote and automatically assumes it corresponds to a quote at the end of
and will fail with mismatched quotes without realizing what it's done.
The most common solution I could find is to double-quote the
string if you need it to properly handle the extra spaces.
The attached patch currently passes the tests with Python 2.6.4 on Ubuntu and Python 2.6.5 on Windows (both with and without spaces in the
It's not an incredibly urgent bug, but I figured I'd add a fix here.
Change History (9)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Ready for checkin|