Issue 17903: Python launcher for windows should search path for #!/usr/bin/env (original) (raw)

The Python launcher for windows should recognise a hashbang line of #!/usr/bin/env python, and use the python executable found on PATH to run the script. If no python executable is present on PATH the launcher should fall back to the current behaviour (using the default python, as if #!/usr/bin/python were present).

This matches the behaviour on other platforms where env is used to ensure that the script uses the user's currently activated Python, and is particularly important when virtualenvs are being used.