This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author James.Sanders
Recipients James.Sanders, akineko, asvetlov, jahakala, pbwinston
Date 2013-08-17.15:06:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376751964.04.0.0494701782456.issue5527@psf.upfronthosting.co.za>
In-reply-to
Content
I did a bit more digging and I think I've worked out what is going on.  The particular bit of tcl initialization code that triggers the problem if it is run before the fork is Tcl_InitNotifier in tclUnixNotify.c.  It turns out there is a known problem with this bit of tcl not being process-safe if tcl was built with threading support (this is discussed at https://bugs.archlinux.org/task/16401, for example).

The bug doesn't show up in my 8.5 builds as threading support is off by default, though the debian/ubuntu packages apparently have it switched on.  Threading was turned on by default in 8.6, but a recent change to tclUnixNotify.c (discussed at https://issues.apache.org/bugzilla/show_bug.cgi?id=55153#c13 - it should be included in 8.6.1 and 8.5.15) appears to have fixed the whole problem anyway.

So hopefully the bug should disappear entirely in future releases of tcl, but for now you can work around it by building tcl without threads, calling exec in between the fork and any use of tkinter in the child process, or not importing tkinter until after the fork.  I don't know if there should be a note about this somewhere in the tkinter docs?
History
Date User Action Args
2013-08-17 15:06:04James.Sanderssetrecipients: + James.Sanders, akineko, jahakala, asvetlov, pbwinston
2013-08-17 15:06:04James.Sanderssetmessageid: <1376751964.04.0.0494701782456.issue5527@psf.upfronthosting.co.za>
2013-08-17 15:06:04James.Sanderslinkissue5527 messages
2013-08-17 15:06:03James.Sanderscreate