New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tkinter goes into an infinite loop (pydoc.gui) #48085
Comments
With version 3.0 (SVN 66386) import pydoc
pydoc.gui() gives >>> Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.0/threading.py", line 507, in
_bootstrap_inner
self.run()
File "/usr/local/lib/python3.0/threading.py", line 462, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.0/pydoc.py", line 1989, in serve
DocServer(port, callback).serve_until_quit()
File "/usr/local/lib/python3.0/pydoc.py", line 1971, in __init__
self.base.__init__(self, self.address, self.handler)
File "/usr/local/lib/python3.0/socketserver.py", line 401, in __init__
self.server_activate()
File "/usr/local/lib/python3.0/pydoc.py", line 1982, in
server_activate
if self.callback: self.callback(self)
File "/usr/local/lib/python3.0/pydoc.py", line 2072, in ready
text='Python documentation server at\n' + server.url)
File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1199, in
configure
return self._configure('configure', cnf, kw)
File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1190, in
_configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: out of stack space (infinite loop?) |
What tcl/tk version are you using ? Also, can you put a "print(_flatten((self._w, cmd)) + |
I'm using Tcl/Tk 8.5.4 here print(":::")
print(_flatten((self._w, cmd)) + self._options(cnf)) produces:
:::
('.3073836300', 'configure', '-yscrollcommand', '3077632332set')
:::
('.3073835564.3073835660', 'configure', '-text', 'Python documentation
server at\nhttp://localhost:7464/')
>>> Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.0/threading.py", line 507, in
_bootstrap_inner
self.run()
File "/usr/local/lib/python3.0/threading.py", line 462, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.0/pydoc.py", line 1989, in serve
DocServer(port, callback).serve_until_quit()
File "/usr/local/lib/python3.0/pydoc.py", line 1971, in __init__
self.base.__init__(self, self.address, self.handler)
File "/usr/local/lib/python3.0/socketserver.py", line 401, in __init__
self.server_activate()
File "/usr/local/lib/python3.0/pydoc.py", line 1982, in
server_activate
if self.callback: self.callback(self)
File "/usr/local/lib/python3.0/pydoc.py", line 2072, in ready
text='Python documentation server at\n' + server.url)
File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1201, in
configure
return self._configure('configure', cnf, kw)
File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1192, in
_configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: out of stack space (infinite loop?) |
Uhm, is it caused only by the combination of tk 8.5.4 and py3k, or does It would be good if you could test some other combination, specially |
Just reproduced the issue under python-trunk with tcl/tk 8.5.4 and 8.5.3 |
But it happens only if you don't build tcl/tk with --enable-threads =) |
If you remove the widget.config calls in GUI.ready you will notice the To reproduce the problem try this (change Tkinter to tkinter if py3k): import threading
import Tkinter
lbl = Tkinter.Label(text="hi")
threading.Thread(target=lambda: lbl.configure(text="hi there")).start()
lbl.mainloop() If your tcl/tk libs weren't compiled with --enable-threads this should |
Many thanks, that solved the problem. Since the cause of the problem wasn't easy to find out would be possible to check at import time if Tcl/Tk has been Helmut. |
The patch attached checks for that when an interpreter is created, not But my real concern is that tkinter thinks it will work properly when |
Push updated patch for tip (3.3) head |
New changeset d731dcda2611 by Martin v. Löwis in branch 'default': |
Thanks for the patch! |
New changeset 7cbc48324938 by Andrew Svetlov in branch 'default': |
Recall to 'open' state |
Close as 'not a bug' because Guilherme's test to reproduce the bug from msg73304 works good at least for Linux. So current behavior is correct and should not to be fixed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: