[issue5492] Error on leaving IDLE with quit() or exit() under Linux

2013-05-04 Thread Ger Luijten

Ger Luijten added the comment:

Hello Roger,

Thanks for the clear explanation!

Greetings, Ger

2013/4/20 Roger Serwy rep...@bugs.python.org


 Roger Serwy added the comment:

 Good catch Terry! I've been testing using python -m idlelib.idle instead
 of importing it from an interactive prompt. I'll need to remember to
 consider that test vector in the future.

 I figured out why those messages are popping up. The Tk event loop remains
 running when in the interactive Python REPL due to a PyOS_InputHook driving
 the Tk loop periodically. Some .after callbacks expire and Tcl tries
 calling into a Python function that no longer exists. The ColorDelegator's
 recolorize() and PyShell's poll_subprocess() are the callbacks. (Adding a
 print(name, func) to the after() function in Lib/tkinter/__init__.py
 revealed the link between the Tcl reference name and the Python reference
 name.)

 The extra ColorDelegator call is actually a bug, related to #13495. (I
 need to expand it that issue to include this new problem.) Two
 ColorDelegators get loaded, and only one gets its close() method called
 which properly cancels the .after callback into recolorize. The orphaned
 ColorDelegator still exists in the delegator chain with an active .after
 callback.

 Once both those .after callbacks are canceled, then the error messages
 Terry sees are no longer shown.

 The rev1 patch includes extra code to handle cancellation of the
 poll_subprocess .after callback. I'll be posting the multi-color delegator
 fix to #13495.

 --
 dependencies: +IDLE: Regressions - Two ColorDelegator instances loaded and
 -e no longer edits new files.
 Added file: http://bugs.python.org/file29945/issue5492_rev1.patch

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue5492
 ___


--

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



[issue5492] Error on leaving IDLE with quit() or exit() under Linux

2013-04-17 Thread Ger Luijten

Ger Luijten added the comment:

Hello Roger,

To you and others that worked on this bug a big thanks for the extra deep
dig into the chain of events to find this old bug and fix it. Impressive!

Because I'm not familiar with the inner workings that cause this bug I was
wondering if the kill command you use is the structural solution or just a
clever workarond to prevent the error being written to the text widget and
forcing the program to stop abruptly.

For me your explanation raised the question if other processes that should
terminate normally are now prevented from doing so and for instance are not
able to do clear allocated memory (garbage collection).

Could you shed some light on your bug fix?

Greetings, Ger

2013/4/1 Roger Serwy rep...@bugs.python.org


 Roger Serwy added the comment:

 I found the root cause of the original error.

 Entering exit() at the shell raises SystemExit which gets written to the
 shell's text widget. The call to actually write the text passes through
 .write() in Lib/idlelib/OutputWindow.py, which calls text.update(). The
 call to .update() enters the Tk event loop and flushes pending events,
 including expired .after callbacks.

 Forcing the .after callback in .close() to 1 ms will always trigger the
 error. Commenting out the text.update() in OutputWindow.py avoids the error.

 The patch causes .kill_subprocess() to execute immediately which prevents
 the subprocess from writing to sys.stderr.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue5492
 ___


--

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



[issue5494] Failure in test_httpservers on Linux

2009-03-15 Thread Ger Luijten

New submission from Ger Luijten gcjm.luij...@gmail.com:

Hello developers,

While running 'make test' for Python 3.1a1 there was an error reported,
obviously a permission problem, but when trying to run the reported
server.py script in verbose mode it turned up an error in the
regrtest.py script. 
Manually running the server.py script seems to go fine.
See my installation notes below.

Commands were issued with and without sudo in a terminal under fully
updated Kubuntu 8.10 and with no installation problems for Python 3.1a1.

Also I noticed Issue 4951 failure in test_httpserver under Windows, but
with a different kind of error message.

Greetings, Ger

$ sudo make test
Errors: 1 error reported; no idea what the script server.py is trying to
access for which it says to have no rights.

This error was listed 3 times:

test_httpservers   

Traceback (most recent call last): 

  File
/home/ger/Systeembeheer/Python/Python_Packages/Python-3.1a1/Lib/http/server.py,
line 1031, in run_cgi  
OSError: [Errno 13] Permission denied  
   
   
test test_httpservers failed -- errors occurred; run in verbose mode for
details  

See the readme file for the Python installation on how to run the script
in verbose mode:
General: $ ./python Lib/test/regrtest.py -v test_whatever
So go to the folder Python-3.1a1/Lib/test/
Run testscript in verbose mode: $ sudo ./regrtest.py -v server.py

No idea if this regrtest.py script knows the path to server.py,
otherwise add the correct path later in testing.

This shows a programming error in the regrtest.py script, so a run of
server.py is not possible with this script:
  File ./regrtest.py, line 185
print(msg, file=sys.stderr)
   ^
SyntaxError: invalid syntax


So let's run the server.py script directly to see if this script crashes
or not.

When directly running the server.py script with and without sudo it runs
with no errors, until broken off by Ctrl+C. 
The script seems to run or simulate a small webserver for tests.

Python-3.1a1/Lib/http$ sudo python3.1 server.py
Serving HTTP on 0.0.0.0 port 8000 ...
^CTraceback (most recent call last):
  File server.py, line 1101, in module
test(HandlerClass=BaseHTTPRequestHandler)
  File server.py, line 1097, in test
httpd.serve_forever()
  File /usr/local/lib/python3.1/socketserver.py, line 224, in
serve_forever
r, w, e = select.select([self], [], [], poll_interval)
KeyboardInterrupt

--
components: Tests
messages: 83631
nosy: gerluijten
severity: normal
status: open
title: Failure in test_httpservers on Linux
type: crash
versions: Python 3.1

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



[issue4951] failure in test_httpservers

2009-03-15 Thread Ger Luijten

Ger Luijten gcjm.luij...@gmail.com added the comment:

Reported Issue 5494 Failure in test_httpservers on Linux with other
error message. Maybe there is a relation, maybe not.
Greetings, Ger

--
nosy: +gerluijten

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