Skip to content
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

Fatal Python error: PyEval_RestoreThread: NULL tstate on example script.. #59432

Closed
tmaslach mannequin opened this issue Jun 30, 2012 · 3 comments
Closed

Fatal Python error: PyEval_RestoreThread: NULL tstate on example script.. #59432

tmaslach mannequin opened this issue Jun 30, 2012 · 3 comments
Labels
topic-tkinter type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@tmaslach
Copy link
Mannequin

tmaslach mannequin commented Jun 30, 2012

BPO 15227
Nosy @loewis, @terryjreedy, @serhiy-storchaka

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:

assignee = None
closed_at = <Date 2015-04-07.09:25:20.741>
created_at = <Date 2012-06-30.04:25:56.038>
labels = ['expert-tkinter', 'type-crash']
title = 'Fatal Python error: PyEval_RestoreThread: NULL tstate on example script..'
updated_at = <Date 2015-04-07.09:25:20.740>
user = 'https://bugs.python.org/tmaslach'

bugs.python.org fields:

activity = <Date 2015-04-07.09:25:20.740>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = True
closed_date = <Date 2015-04-07.09:25:20.741>
closer = 'serhiy.storchaka'
components = ['Tkinter']
creation = <Date 2012-06-30.04:25:56.038>
creator = 'tmaslach'
dependencies = []
files = []
hgrepos = []
issue_num = 15227
keywords = []
message_count = 3.0
messages = ['164367', '164748', '211096']
nosy_count = 5.0
nosy_names = ['loewis', 'terry.reedy', 'gpolo', 'serhiy.storchaka', 'tmaslach']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue15227'
versions = ['Python 2.7']

@tmaslach
Copy link
Mannequin Author

tmaslach mannequin commented Jun 30, 2012

I've been running into a bug recently and reduced the code to the following:

import Tkinter                    
tk = Tkinter.Tk()
window = Tkinter.Frame(tk)
def onDestroy (event):
  pass
window.bind ("<Destroy>", onDestroy)

Just run and the following will be displayed:
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

If you add window.mainloop(), the issue goes aware. However, I don't do that in my case. window.update(), by the way, still causes the crash if that is of any interest (I found this tinkering)..

I'm running with:

  • Window 7
  • Python 2.7.2
  • 64-bit machine, but 32-bit Python

Thanks!

@tmaslach tmaslach mannequin added topic-tkinter type-crash A hard crash of the interpreter, possibly with a core dump labels Jun 30, 2012
@terryjreedy
Copy link
Member

On 3.3b0, Win7, 64-64 bit, run from IDLE, script brings up empty tk window. Closing it gives prompt back in Shell window.

Maslach, can you retry with 2.7.3 (bug fix is generally a good idea anyway) and maybe 64 bit version (you can install both 32 bit and 64 bit if you specify different directory -- I have done it.)

@tmaslach
Copy link
Mannequin Author

tmaslach mannequin commented Feb 12, 2014

I just tried this in Python 2.7.6 and it works... So, it looks to be fixed!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

3 participants