On Mon, Jul 5, 2010 at 6:06 PM, Craig McQueen <[email protected]> wrote: > On Tue 6/07/2010 2:55 AM, Anthony Tuininga wrote: >> On Sun, Jul 4, 2010 at 5:45 PM, Craig McQueen >> <[email protected]> wrote: >>> On Sat 3/07/2010 4:25 AM, Anthony Tuininga wrote: >>>> On Thu, Jul 1, 2010 at 9:03 PM, Craig McQueen >>>> <[email protected]> wrote: >>>>> I looked at the source code, and found that in the >>>>> initscripts/Console.py-- >>>>> http://cx-freeze.svn.sourceforge.net/viewvc/cx-freeze/trunk/initscripts/Console.py?revision=205&view=markup >>>>> >>>>> --there are the following lines: >>>>> >>>>> if sys.version_info[:2]>= (2, 5): >>>>> module = sys.modules.get("threading") >>>>> if module is not None: >>>>> module._shutdown() >>>>> >>>>> If these lines are commented-out, then the error message at exit does not >>>>> occur. >>>>> >>>>> Why are those lines there, and what is the consequence of me removing >>>>> them? >>>> Hi Craig, >>>> >>>> The reason those lines are there is because without them any threads >>>> that are currently running will simply die when the application ends. >>>> The Python interpreter itself calls an internal routine that waits for >>>> the threads to terminate on their own. Its unfortunate that this isn't >>>> included inside Py_Finalize() but its not. Before Python 2.5, this was >>>> done via means of an atexit function (which happened inside >>>> Py_Finalize) but with Python 2.5 and up this has been changed to call >>>> a special function within the main routine of the Python interpreter. >>>> I have replicated the behavior using the above lines and that has >>>> worked for me for some time. Would you be able to send me a sample >>>> program that I can run and that demonstrates the problem? Thanks. >>>> >>> Try a Python program that contains only a single line: >>> >>> import threading >>> >>> Of course, it does nothing useful, and should just return without doing or >>> printing anything. >>> >>> On Python 2.6.5, on both Windows 2000 and Ubuntu Linux 10.04, if I make an >>> executable with cx_Freeze >>> 4.1.2, when I run it I get the error message as described above. >> Indeed. I just checked and this has been fixed in Python 2.6 (released >> in 2.6.5) and now Python 2.7. The same code is in Python 3.1 so only >> Python 2.5 is still broken. So I'll be changing this to look for >> Python 2.5 only. Anyone else who runs into the problem in Python 2.6 >> can write this code themselves or update to the latest bugfix release. > > Great! Thanks for looking into this.
You're welcome. > I suppose if you wanted to be kind to people who don't have the latest Python > 2.6, you could use the > check: > > if (2,5,0) <= sys.version_info[:3] <= (2,6,4): Yes, I suppose that is true. :-) Anthony ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ cx-freeze-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
