Sagar Khushalani wrote:
> I'm using wxPython and the processing module. I create a "main" file 
> which has a gui with buttons. Each button creates starts a separate 
> process. However, when I click any of the buttons, I get an 
> stderr/stdout box from wxPython with the following error. I checked 
> online, and found some similar errors that are related to bugs, but 
> they were not exactly the same. Has anyone had the same problem?
>  
> Traceback (most recent call last):
>   File "C:\Homework\Python\main.py", line 54, in startP1
>     p1.start()
>   File "C:\Python25\Lib\site-packages\processing\process.py", line 
> 111, in start
>     self._popen = Popen(self, self._stoppable)
>   File "C:\Python25\Lib\site-packages\processing\process.py", line 
> 393, in __init__
>     creationflags=new_console and CREATE_NEW_PROCESS_GROUP
>   File "C:\Python25\lib\subprocess.py", line 586, in __init__
>     errread, errwrite) = self._get_handles(stdin, stdout, stderr)
>   File "C:\Python25\lib\subprocess.py", line 715, in _get_handles
>     c2pwrite = self._make_inheritable(c2pwrite)
>   File "C:\Python25\lib\subprocess.py", line 744, in _make_inheritable
>     DUPLICATE_SAME_ACCESS)
> WindowsError: [Error 6] The handle is invalid
> I get this error regardless of whether I run it from IDLE or from the 
> DOS prompt.

By default, a Windows GUI application does not have stdin (or stdout or 
stderr, but wxPython can provide those).  The files are not created, so 
the handles are invalid.

You might try something like this:
    sys.stdin = open('nul','rb')
If that doesn't work, try asking on the wxPython mailing list.

-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to