This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kartlee05
Recipients kartlee05
Date 2012-11-12.02:49:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352688567.58.0.199976634188.issue16458@psf.upfronthosting.co.za>
In-reply-to
Content
Please download subprocess.zip and extract the archive. Run - 

perl test.pl

you will notice 'invalid handle' error on duplicating STD_INPUT_HANDLE in python. This is observed in Windows XP SP3. Vista SP2 and higher platforms doesn't show this failure when I checked.

"test.pl" spawn a python process "test.py" using CREATE_NEW_PROCESS_GROUP flag. Before it does, it close STDIN and create a listening socket. Perl under the hood, convert the socket handle to file descriptor using open_osfhandle(..) call. When it does this, the C runtime set the standard input handle to this descriptor  for console app. [ See msvcr* osfinfo.c code - SetStdHandle( STD_INPUT_HANDLE, (HANDLE)value )  ]. As a result, when you get the STD_INPUT_HANDLE, you will get the new one. Duplicating this handle, hence throw the invalid handle error in Windows XP SP3. 

When I looked at MSDN for DuplicateHandle(..), it is mentioned not to duplicate socket handle using this call. So I suspect something going wrong in XP platform. To fix this issue, I have come up with a patch - python-2143_patch. Please take a look and let me know your comments.

-Karthik
History
Date User Action Args
2012-11-12 02:49:27kartlee05setrecipients: + kartlee05
2012-11-12 02:49:27kartlee05setmessageid: <1352688567.58.0.199976634188.issue16458@psf.upfronthosting.co.za>
2012-11-12 02:49:27kartlee05linkissue16458 messages
2012-11-12 02:49:26kartlee05create