[issue1124861] subprocess fails on GetStdHandle in interactive GUI

2013-03-04 Thread Tomgu

Tomgu added the comment:

Here I get one problem need help. 
In python 2.7.5 version I write a script test.py as below
###
import subprocess
fileID=file('test1.log','w')
process_response = subprocess.call('netsh wlan show\ 
interface',stdout=fileID,shell=True)
fileID.flush()
fileID.close()
###
It run in windows7 os MSDOS console is OK
and I try to run it in STAF command

C:\ STAF local PROCESS START COMMAND python C:\test.py WAIT STDERRTOSTDOUT 
RETURNSTDOUT

Response

{
  Return Code: 1
  Key: None
  Files  : [
{
  Return Code: 0
  Data   : Traceback (most recent call last):
  File C:\test.py, line 3, in module
process_response = subprocess.call('netsh wlan show interface',stdout=fileID
,shell=True)
  File C:\Python27\lib\subprocess.py, line 493, in call
return Popen(*popenargs, **kwargs).wait()
  File C:\Python27\lib\subprocess.py, line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File C:\Python27\lib\subprocess.py, line 784, in _get_handles
p2cread = self._make_inheritable(p2cread)
  File C:\Python27\lib\subprocess.py, line 823, in _make_inheritable
_subprocess.DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] The handle is invalid

}
  ]

I just start to learn python, I dont know how to resolve, need help.

--
nosy: +gwtking
type:  - compile error
versions: +Python 2.7 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1124861
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1124861] subprocess fails on GetStdHandle in interactive GUI

2013-03-04 Thread Tomgu

Tomgu added the comment:

Update, the python version is '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC 
v.1500 32 bit (Intel)]'

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1124861
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17350] Use STAF call python script will case 1124861 issue in 2.7.2 version

2013-03-04 Thread Tomgu

New submission from Tomgu:

Here I get one problem use STAF call python and need help. 
In python 2.7.2 version I write a script test.py as below
###
import subprocess
fileID=file('test1.log','w')
process_response = subprocess.call('netsh wlan show\ 
interface',stdout=fileID,shell=True)
fileID.flush()
fileID.close()
###
It run in windows7 os MSDOS console is OK
and I try to run it in STAF command

C:\ STAF local PROCESS START COMMAND python C:\test.py WAIT STDERRTOSTDOUT 
RETURNSTDOUT

Response

{
  Return Code: 1
  Key: None
  Files  : [
{
  Return Code: 0
  Data   : Traceback (most recent call last):
  File C:\test.py, line 3, in module
process_response = subprocess.call('netsh wlan show interface',stdout=fileID
,shell=True)
  File C:\Python27\lib\subprocess.py, line 493, in call
return Popen(*popenargs, **kwargs).wait()
  File C:\Python27\lib\subprocess.py, line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File C:\Python27\lib\subprocess.py, line 784, in _get_handles
p2cread = self._make_inheritable(p2cread)
  File C:\Python27\lib\subprocess.py, line 823, in _make_inheritable
_subprocess.DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] The handle is invalid

}
  ]

Like known issue 1124861. I just start to learn python, I dont know how to 
resolve, need help.

--
messages: 183444
nosy: gwtking
priority: normal
severity: normal
status: open
title: Use STAF call python script will case 1124861 issue in 2.7.2 version
type: crash
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17350
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com