[Twisted-Python] spawnProcess under Win32

Igor Kravtchenko igor at mekensleep.com
Mon Aug 14 11:02:07 EDT 2006


Hi,

yes I see your point of view.
I deliberately passed that Win32 flags since I didn't wanted to get in 
details
of what kind of Win32 features we need or not.
It can indeed potentially breaks Twisted behavior if incorrect flags are 
passed.

However it's just easier even if less secure.  Otherwise, you have to 
enumerate
all kind of features users want and implement them explicitly while 
having the
correct code guard to prevent from crash or incorrect behavior.

I don't know about other Win32 developpers.  From my side, I just wanted
a way to prevent a console to be opened, so might be something like an
explicit CREATE_NO_CONSOLE flag or such.

Igor.



glyph at divmod.com wrote:

>
>
> On Mon, 14 Aug 2006 15:15:55 +0200, Igor Kravtchenko 
> <igor at mekensleep.com> wrote:
>
>> Hi!
>
>
>> I've looked at the way Twisted creates a process under Win32 and I've 
>> noticed
>> that it uses the CreateProcess() function.  The problem is it doesn't 
>> mention any
>> creation flags (i.e.: it just passes 0) whereas here, we would need 
>> to pass
>> DETACHED_PROCESS to avoid a new console to be created.
>
>
>> I would be interested to know what do you think about this?
>> Does it seem to you a good idea?
>
>
> Well, we do have a UNIX-specific argument to spawnProcess (usePTY), so 
> I don't see why we couldn't have a Win32-specific argument as well.  
> However, "win32flags" seems like a pretty vague name, especially since 
> it could be CreateProcess's dwCreationFlags argument or STARTUPINFO's 
> dwFlags attribute.
>
> Also, depending on context, you might want CREATE_NO_WINDOW or 
> DETACHED_PROCESS or possibly both.
>
> I believe the right thing to do is to come up with some typical 
> features of the Windows process environment and support them 
> explicitly.  I don't believe all the flags you can pass to 
> CreateProcess are compatible with the way Twisted expects subprocesses 
> to behave, and I am definitely sure that not all the things you can 
> put in STARTUPINFO are.
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>





More information about the Twisted-Python mailing list