Login | Register
My pages Projects Community openCollabNet

Discussions > User > RE: How to use Parts with MinGW?

parts
Discussion topic

Back to topic list

RE: How to use Parts with MinGW?

Author lrn
Full name LRN
Date 2012-07-12 09:54:26 PDT
Message > Hopefully this will not clash much with your patches.

It almost doesn't, except for the:
+ proc.wait()
change, which gets wrong indentation. Otherwise everything looks to be in order.

I should also not that your "while running: ... running = proc.poll() is None" code results in a busyloop on W32 (python.exe consuming one CPU core completely). Because poll() returns immediately (it just does WaitForSingleObject on process handle with 0 timeout).

The proc.kill() bug you mention in a comment is indeed known - but not understood. People hypothesized that TerminateProcess() on a valid handle you get from CreateProcess() might fail with "Access denied" when the other process is within a syscall, and that trying again later might work. Or when the process already terminated (in which case GetExitCodeProcess() will give you its exit code instead of STILL_ALIVE).

Then, the taskkill solution you're using is not exactly a solution - it can fail just as well (not to mention that in my particular case it didn't work at all - os.system() said that it doesn't know what taskkill is, even though it's in system32 and should be available; maybe something was wrong with the PATH, i don't know).

Maybe it's possible to implement [1] in Python...That would be cool.

[1] http://private-storm​.de/2009/08/11/case-​terminateprocess/

« Previous message in topic | 16 of 22 | Next message in topic »

Messages

Show all messages in topic

How to use Parts with MinGW? lrn LRN 2012-06-12 10:02:35 PDT
     RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-06-12 12:27:14 PDT
         RE: How to use Parts with MinGW? lrn LRN 2012-06-14 03:21:17 PDT
             RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-06-14 21:20:37 PDT
                 RE: How to use Parts with MinGW? lrn LRN 2012-06-15 01:13:17 PDT
                     RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-06-15 07:33:46 PDT
                         RE: How to use Parts with MinGW? lrn LRN 2012-06-16 02:59:45 PDT
                             RE: How to use Parts with MinGW? lrn LRN 2012-06-16 08:25:06 PDT
                     RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-06-21 14:15:14 PDT
                         RE: How to use Parts with MinGW? lrn LRN 2012-06-23 00:05:04 PDT
                             RE: How to use Parts with MinGW? lrn LRN 2012-06-23 16:17:21 PDT
                             RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-06-26 13:02:48 PDT
                                 RE: How to use Parts with MinGW? lrn LRN 2012-06-26 22:00:08 PDT
                                     Re: How to use Parts with MinGW? lrn LRN 2012-07-11 08:22:26 PDT
                                         RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-07-11 14:03:07 PDT
                                             RE: How to use Parts with MinGW? lrn LRN 2012-07-12 09:54:26 PDT
                                                 RE: How to use Parts with MinGW? lrn LRN 2012-07-12 10:59:58 PDT
                                                     RE: How to use Parts with MinGW? lrn LRN 2012-07-12 11:04:00 PDT
                                                 RE: How to use Parts with MinGW? jason_at_intel Jason Kenny 2012-07-12 11:56:43 PDT
                                                     RE: How to use Parts with MinGW? lrn LRN 2012-07-13 06:31:15 PDT
                     RE: How to use Parts with MinGW? lrn LRN 2012-06-23 18:35:01 PDT
                         RE: How to use Parts with MinGW? lrn LRN 2012-06-25 12:09:35 PDT
Messages per page: