classification
Title: Add sys.executable to test_subprocessing.CommandsWithSpaces shell tests
Type: behavior Stage: resolved
Components: Tests, Windows Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brian.curtin Nosy List: brian.curtin, tim.golden
Priority: low Keywords: patch

Created on 2010-08-13 16:33 by brian.curtin, last changed 2010-08-13 21:04 by brian.curtin. This issue is now closed.

Files
File name Uploaded Description Edit
issue9588.diff brian.curtin, 2010-08-13 17:09 py3k
9588.exec.patch tim.golden, 2010-08-13 20:16
Messages (5)
msg113794 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-08-13 16:33
The fix for #2304 causes issues on Windows if you have file associations setup that aren't Python interpters. In my case I have an association setup to open .py files in gvim, which causes the shell tests to hang until I quit the editor, then it fails because the output from gvim (nothing) doesn't match what it would when run through an interpreter.

CommandsWithSpaces.test_shell_* tests should have a skip condition which checks file associations before running. The info is stored somewhere in the registry, so it should be easy to see that, e.g., gvim.exe isn't a valid Python interpreter.

This issue only affects me at the moment, but it could affect other users who have tweaked file associations.
msg113797 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-08-13 17:09
Attached is a patch that fixes this for me, and I *think* it's looking in the most correct area for the information.

Tim or any other Windows users, would you mind seeing that the skip does not occur on your machines, thus allowing it to properly run those tests?
msg113824 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2010-08-13 20:16
Assuming I understand you correctly, could I propose this rather less involved patch which simply specifies the sys.executable as part of the command line. The test doesn't propose to test file associations and indeed two of the test already fill in the executable
msg113825 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-08-13 20:18
Yeah that's much better :)
I should have asked if you left out sys.executable out intentionally before coming up with my patch...I assumed it was intended to be different due to shell=1 or something.

Go ahead and apply if you want.
msg113831 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-08-13 21:04
Fixed in r83983, r83984, and r83985. Thanks, Tim.
History
Date User Action Args
2010-08-13 21:04:04brian.curtinsetstatus: open -> closed

assignee: tim.golden -> brian.curtin
title: Skip subprocess shell tests on Windows per file association setup -> Add sys.executable to test_subprocessing.CommandsWithSpaces shell tests
resolution: fixed
versions: + Python 3.1, Python 2.7
messages: + msg113831
stage: needs patch -> resolved
2010-08-13 20:18:59brian.curtinsetassignee: brian.curtin -> tim.golden
messages: + msg113825
2010-08-13 20:16:09tim.goldensetfiles: + 9588.exec.patch

messages: + msg113824
2010-08-13 17:09:43brian.curtinsetfiles: + issue9588.diff
keywords: + patch
messages: + msg113797
2010-08-13 16:33:08brian.curtincreate