Re: [Python-Dev] test_socketserver flakey?
Guido van Rossum wrote: > The test_socketserver unittest seems to be failing occasionally for > me. (Svn HEAD, Ubuntu dapper.) Specifically, which test is failing? -- Cheers, Hasan Diwan <[EMAIL PROTECTED]> ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Distutils and -framework on MacOSX
On 30 Mar, 2007, at 7:27, Greg Ewing wrote: > Ronald Oussoren wrote: > >> What's wrong with adding -framework flags to the end? I do this >> all the time and have yet to run into problems. > > I don't know what's wrong. Sometimes it works for me too, > but often it doesn't, and when it doesn't, putting them > at the front seems to fix it. Could you create an example where adding -framework to the end of the command-line doesn't work? BTW. I'm asking around for a more definitive statement on how - framework arguments are interpreted. Ronald ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Martin v. Löwis wrote: > On Win32, you also have subprocess.TerminateProcess, if you have the > subprocess module in the first place. The problem of TerminateProcess is that I need the handle of the process. I don't like the idea of rely on the private _handle and do: process = subprocess.Popen(...) ... subprocess.TerminateProcess(int(process._handle), -1) so, I'll end doing this: -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Martin v. Löwis wrote: > On Win32, you also have subprocess.TerminateProcess, if you have the > subprocess module in the first place. The problem of TerminateProcess is that I need the handle of the process. I don't like the idea of rely on the private _handle and do: process = subprocess.Popen(...) ... subprocess.TerminateProcess(int(process._handle), -1) so, I'll end doing this: process = subprocess.Popen(...) ... handle =ctypes.windll.kernel32.OpenProcess(1, False, process.pid) ctypes.windll.kernel32.TerminateProcess(handle, -1) ctypes.windll.kernel32.CloseHandle(handle) Is this ok? Thank you!! -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
[sorry if you see 2 copies of this] Facundo Batista wrote: > The problem of TerminateProcess is that I need the handle of the > process. > > I don't like the idea of rely on the private _handle and do: > > process = subprocess.Popen(...) > ... > subprocess.TerminateProcess(int(process._handle), -1) > > so, I'll end doing this: > > process = subprocess.Popen(...) > ... > handle =ctypes.windll.kernel32.OpenProcess(1, False, process.pid) > ctypes.windll.kernel32.TerminateProcess(handle, -1) > ctypes.windll.kernel32.CloseHandle(handle) > > Is this ok? Would it not be better to put a platform-independent version of this into subprocess, so that this code doesn't have to be duplicated all over the place? Maybe a method on a Popen object called terminate()? That way you wouldn't even need ctypes, since you could look at the _handle without feeling bad about it! Eric. ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Eric V. Smith wrote: > Would it not be better to put a platform-independent version of this > into subprocess, so that this code doesn't have to be duplicated all > over the place? Maybe a method on a Popen object called terminate()? Yes. But I'm not up to that task. Really don't know how to kill processes in *all* the platforms where Python's subprocess is present. My problem is smaller, I'm making a new tests in test_socket_ssl.py, and I just wanted to support win32 (as well as Unix and Macintosh). Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] test_socketserver flakey?
On 4/3/07, Hasan Diwan <[EMAIL PROTECTED]> wrote: > > Guido van Rossum wrote: > > > The test_socketserver unittest seems to be failing occasionally for > > > me. (Svn HEAD, Ubuntu dapper.) > > Specifically, which test is failing? Hard to say -- so far, I've just seen the blanket "test failed" report from regrtest.py, occasionally. The few times I ran the test directly it passed. I'll try running it in a loop to see what happens. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] test_socketserver flakey?
On 4/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/3/07, Hasan Diwan <[EMAIL PROTECTED]> wrote: > > > Guido van Rossum wrote: > > > > The test_socketserver unittest seems to be failing occasionally for > > > > me. (Svn HEAD, Ubuntu dapper.) > > > > Specifically, which test is failing? > > Hard to say -- so far, I've just seen the blanket "test failed" report > from regrtest.py, occasionally. The few times I ran the test directly > it passed. I'll try running it in a loop to see what happens. OK, did that, after a bunch of iterations it failed like this: ADDR = @test17637 CLASS = SocketServer.UnixStreamServer server created server running test client 0 test test_socketserver crashed -- : (2, 'No such file or directory') Traceback (most recent call last): File "../Lib/test/regrtest.py", line 557, in runtest_inner indirect_test() File "/usr/local/google/home/guido/python/trunk/Lib/test/test_socketserver.py", line 212, in test_main testall() File "/usr/local/google/home/guido/python/trunk/Lib/test/test_socketserver.py", line 200, in testall testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream) File "/usr/local/google/home/guido/python/trunk/Lib/test/test_socketserver.py", line 144, in testloop testfunc(proto, addr) File "/usr/local/google/home/guido/python/trunk/Lib/test/test_socketserver.py", line 62, in teststream s.connect(addr) File "", line 1, in connect error: (2, 'No such file or directory') -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Facundo Batista wrote: > Eric V. Smith wrote: > >> Would it not be better to put a platform-independent version of this >> into subprocess, so that this code doesn't have to be duplicated all >> over the place? Maybe a method on a Popen object called terminate()? > > Yes. But I'm not up to that task. Really don't know how to kill > processes in *all* the platforms where Python's subprocess is present. I'd be willing to look at adding it, if the group thinks it's the right thing to do. Eric. ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
> I'd be willing to look at adding it, if the group thinks it's the right > thing to do. I like the idea and I'm proposing to add two more methods to subprocess Popen. class Popen(...): ... def signal(self, signal): """Send a signal to the process (UNIX only) signal is constant from the signal module """ def terminate(self, force=False): """Terminate the process On UNIX terminate(False) is equivalent to signal(SIGTERM) and terminate(True) to signal(SIGKILL). On Windows ... (does Windows support a forced terminate?) """ Christian ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Eric V. Smith wrote: > I'd be willing to look at adding it, if the group thinks it's the right > thing to do. +1 to have the functionality of "kill the process you started" in subprocess. -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
On 4/3/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > > I'd be willing to look at adding it, if the group thinks it's the right > > thing to do. > > I like the idea and I'm proposing to add two more methods to subprocess > Popen. > > class Popen(...): > ... > def signal(self, signal): > """Send a signal to the process (UNIX only) > > signal is constant from the signal module > """ > > def terminate(self, force=False): > """Terminate the process > > On UNIX terminate(False) is equivalent to signal(SIGTERM) and > terminate(True) to signal(SIGKILL). > > On Windows ... (does Windows support a forced terminate?) > """ Another difference I believe is that TerminateProcess on Windows doesn't kill the tree of processes like kill would. It would be nice if Popen.terminate() did the same thing on both Unix and Windows. (I assume that would mean making *all* the appropriate TerminateProcess calls.) Steve -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
On 4/2/07, Facundo Batista <[EMAIL PROTECTED]> wrote: > I launch openssl through subprocess, but I do *not* find a way to tell > him to quit serving, so all I can do is to kill the process (through the > pid from the Popen object). > > The problem is that os.kill only works in Unix and Macintosh. So, > there's a better way to do this? Or I shall check if I'm in one of those > both platforms and only execute the tests there? I just checked the man page for s_server (on linux) and it mentions something about exiting. "Certain single letter commands are also recognized which perform special operations: these are listed below. q end the current SSL connection but still accept new connections. Q end the current SSL connection and exit." Can a command "Q" be sent to the server once testing is complete? Thanks, Raghu. ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > On 4/3/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > > > I'd be willing to look at adding it, if the group thinks it's the right > > > thing to do. > > > > I like the idea and I'm proposing to add two more methods to subprocess > > Popen. > > > > class Popen(...): > > ... > > def signal(self, signal): > > """Send a signal to the process (UNIX only) > > > > signal is constant from the signal module > > """ > > > > def terminate(self, force=False): > > """Terminate the process > > > > On UNIX terminate(False) is equivalent to signal(SIGTERM) and > > terminate(True) to signal(SIGKILL). > > > > On Windows ... (does Windows support a forced terminate?) > > """ > > Another difference I believe is that TerminateProcess on Windows > doesn't kill the tree of processes like kill would. It would be nice > if Popen.terminate() did the same thing on both Unix and Windows. (I > assume that would mean making *all* the appropriate TerminateProcess > calls.) To kill child processes on Windows, one must walk the tree and kill those as well. wxWidgets has an implementation in src/msw/utils.cpp: http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/msw/utils.cpp See the differences between wxKill and wxKillAllChildren . I would also mention that wxWidgets implements SIGKILL as TerminateProcess(), and SIGTERM as sending a QUIT message to the process. - Josiah ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] test_socketserver flakey?
I'm not sure I agree with your analysis -- the test that fails is using unix domain sockets, not TCP. On 4/3/07, Hasan Diwan <[EMAIL PROTECTED]> wrote: > Guido: > > On 03/04/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > But I saw this failure during a regular regrtest run as well. How > > would you suggest to fix this?i > > > > You'll need to make the connect/close lines into a critical section and have > execution suspended for the TCP wait time. It defaults to 60 seconds on BSD > sockets, but I'm not aware of the constant for it (a quick survey of the > header files doesn't show anything promising). On the other hand, I don't > think you're going to be running this particular test a number of times > quickly (or will you?). In the final examination, I suspect it's a race > condition. > -- > Cheers, > > Hasan Diwan <[EMAIL PROTECTED]> > -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Christian Heimes wrote:
>> I'd be willing to look at adding it, if the group thinks it's the right
>> thing to do.
>
> I like the idea and I'm proposing to add two more methods to subprocess
> Popen.
>
> class Popen(...):
> ...
> def signal(self, signal):
> """Send a signal to the process (UNIX only)
>
> signal is constant from the signal module
> """
>
> def terminate(self, force=False):
> """Terminate the process
>
> On UNIX terminate(False) is equivalent to signal(SIGTERM) and
> terminate(True) to signal(SIGKILL).
>
> On Windows ... (does Windows support a forced terminate?)
> """
Here is what my process.py [1] does for termination (not suggesting you
follow the API here, just showing how it handles termination on
Windows). Some of the Windows logic is borrowed from PyWin32's
winprocess.py [2]
> def kill(self, exitCode=0, gracePeriod=1.0, sig=None):
> """Kill process.
>
> "exitCode" [deprecated, not supported] (Windows only) is the
> code the terminated process should exit with.
> "gracePeriod" (Windows only) is a number of seconds the process is
> allowed to shutdown with a WM_CLOSE signal before a hard
> terminate is called.
> "sig" (Unix only) is the signal to use to kill the process. Defaults
> to signal.SIGKILL. See os.kill() for more information.
>
> Windows:
> Try for an orderly shutdown via WM_CLOSE. If still running
> after gracePeriod (1 sec. default), terminate.
> """
> if sys.platform.startswith("win"):
> import win32gui
> # Send WM_CLOSE to windows in this process group.
> win32gui.EnumWindows(self._close_, 0)
>
> # Send Ctrl-Break signal to all processes attached to this
> # console. This is supposed to trigger shutdown handlers in
> # each of the processes.
> try:
> win32api.GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT,
> self._processId)
> except AttributeError:
> log.warn("The win32api module does not have "\
> "GenerateConsoleCtrlEvent(). This may mean that "\
> "parts of this process group have NOT been killed.")
> except win32api.error, ex:
> if ex.args[0] not in (6, 87):
> # Ignore the following:
> # api_error: (87, 'GenerateConsoleCtrlEvent', 'The
> parameter is incorrect.')
> # api_error: (6, 'GenerateConsoleCtrlEvent', 'The
> handle is invalid.')
> # Get error 6 if there is no console.
> raise
>
> # Last resort: call TerminateProcess if it has not yet.
> retval = 0
> try:
> self.wait(gracePeriod)
> except ProcessError, ex:
> log.info("[%s] Process.kill: calling TerminateProcess",
> id(self))
> win32process.TerminateProcess(self._hProcess, -1)
> win32api.Sleep(100) # wait for resources to be released
>
> else:
> if sig is None:
> sig = signal.SIGKILL
> try:
> os.kill(self._pid, sig)
> except OSError, ex:
> if ex.errno != 3:
> # Ignore: OSError: [Errno 3] No such process
> raise
Links:
[1] http://trentm.com/projects/process/
[2]
http://pywin32.cvs.sourceforge.net/pywin32/pywin32/win32/Demos/winprocess.py?revision=1.2&view=markup#l_121
--
Trent Mick
trentm at activestate.com
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Steven Bethard wrote: > Another difference I believe is that TerminateProcess on Windows > doesn't kill the tree of processes like kill would. It would be nice > if Popen.terminate() did the same thing on both Unix and Windows. (I > assume that would mean making *all* the appropriate TerminateProcess > calls.) Possibly that should be kept separate and handled via eventual handling for process jobs: http://msdn2.microsoft.com/en-us/library/ms684161.aspx > A job object allows groups of processes to be managed as a unit. Job objects > are namable, securable, sharable objects that control attributes of the > processes associated with them. Operations performed on the job object affect > all processes associated with the job object. > > ... > To terminate all processes currently associated with a job object, use the > TerminateJobObject function. Trent -- Trent Mick trentm at activestate.com ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
Raghuram Devarakonda wrote: >Q end the current SSL connection and exit." > > Can a command "Q" be sent to the server once testing is complete? For openssl to recognize your "Q", you need to have a connection active. So, we need a better way to kill the external openssl in the tests (don't killing it sometimes when the connection can not be stablished is not an option). Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
> I don't like the idea of rely on the private _handle and do: > > process = subprocess.Popen(...) > ... > subprocess.TerminateProcess(int(process._handle), -1) > > so, I'll end doing this: > > process = subprocess.Popen(...) > ... > handle =ctypes.windll.kernel32.OpenProcess(1, False, process.pid) > ctypes.windll.kernel32.TerminateProcess(handle, -1) > ctypes.windll.kernel32.CloseHandle(handle) > > Is this ok? I don't like it. I would rather rely on the private _handle member. If that ever gets changed, the test fails. Regards, Martin ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] About SSL tests
> Another difference I believe is that TerminateProcess on Windows > doesn't kill the tree of processes like kill would. I believe you are wrong here: kill on Unix would *not* kill the tree of processes. Killing the parent process just does that: kill the parent process. Killing process groups is an entirely different issue. It would be nice if subprocess also supported process groups (through the same-named POSIX concept on POSIX, and job objects on Win32), but that again is a different story. Regards, Martin ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] A Survey on Defect Management Practices in Free/Open Source Software
Dear Python Contributors, I seek help from designers, developers, testers,defect fixers,project managers or playing any other key role in Free/Open Source software development or maintenence in carrying out a study on practices and problems of defect management in various Free/Open Source Software projects. The insights gained from the study can further help us to extract publicly accessible defect data and determine impact of defect management practices on software quality. Please spend a few minutes of your precious time to fill up the Questionnaire. The most of the questions follow multiple choice formats and are quite easy to answer. To have the Online Questionnaire, please visit: http://anu.puchd.ac.in/phpESP/public/survey.php?name=FOSS_Defect_Survey (You can also copy and paste this link into your browser, and hit the 'Return' key.) I hope you will find all the questions interesting and thought-provoking. Your answers will be kept anonymous.The data thus collected will only be used for research purpose.It would be nice if you may further refer this mail to others actively engaged with Free/Open Source Software development. If you have any query or suggestions then feel free to contact. Thank You With regards, Anu Gupta Senior Lecturer Department of Computer Science and Applications, Panjab University, Chandigarh. INDIA In case of any problem in accessing/using the above mentioned link please contact: E-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] A Survey on Defect Management Practices in Free/Open Source Software
On Wednesday 04 April 2007 14:44, Anu Gupta DCSA wrote: > Dear Python Contributors, > > I seek help from designers, developers, testers,defect > fixers,project managers or playing any other key role in > Free/Open Source software development or maintenence > in carrying out a study on practices and problems of defect > management in various Free/Open Source Software projects. The Just a random aside - is anyone else getting increasingly annoyed by these mass-mailed out survey requests from students? I must get a several a week now. This one was at least personally addressed (well, to "Python Contributors"), which is a step ahead of most of them. -- Anthony Baxter <[EMAIL PROTECTED]> It's never too late to have a happy childhood. ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] A Survey on Defect Management Practices in Free/Open Source Software
Anthony Baxter schrieb: > On Wednesday 04 April 2007 14:44, Anu Gupta DCSA wrote: >> Dear Python Contributors, >> >> I seek help from designers, developers, testers,defect >> fixers,project managers or playing any other key role in >> Free/Open Source software development or maintenence >> in carrying out a study on practices and problems of defect >> management in various Free/Open Source Software projects. The > > Just a random aside - is anyone else getting increasingly annoyed by > these mass-mailed out survey requests from students? I must get a > several a week now. This one was at least personally addressed > (well, to "Python Contributors"), which is a step ahead of most of > them. > Though, in an email targeted at developers, this looks ridiculous to me: | (You can also copy and paste this link into your browser, and hit the | 'Return' key.) cheers, Georg ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
