comparison Python/pythonrun.c @ 44064:00048fedbaa0

Partial fix for bug #1306 Multiple reinitializations of Python 3.0 failed on a system without a hardcoded default fs encoding. The patch makes sure that the default fs encoding is freed and reset to NULL on e.g. Linux. I've also taken the liberty to increase the debugging in Objects/object.c:_Py_ForgetReference(). The method is used to validate the reference chain. Reinitialization still fails in the 3rd round of my test suite: * ob object : <refcnt 0 at 0x821c840> type : str refcount: 0 address : 0x821c840 * op->_ob_prev->_ob_next object : <refcnt 0 at 0x821c840> type : str refcount: 0 address : 0x821c840 * op->_ob_next->_ob_prev object : bytearray(b'') type : bytearray refcount: 1 address : 0x826b838 Fatal Python error: UNREF invalid object
author Christian Heimes <christian@cheimes.de>
date Fri, 30 Nov 2007 10:18:26 +0000
parents 8ed0280c2ab6
children 28c802837252
comparison
equal deleted inserted replaced
44061:0cc552ab76bd 44064:00048fedbaa0
499 PyLong_Fini(); 499 PyLong_Fini();
500 PyFloat_Fini(); 500 PyFloat_Fini();
501 501
502 /* Cleanup Unicode implementation */ 502 /* Cleanup Unicode implementation */
503 _PyUnicode_Fini(); 503 _PyUnicode_Fini();
504
505 /* reset file system default encoding */
506 if (!Py_HasFileSystemDefaultEncoding) {
507 free((char*)Py_FileSystemDefaultEncoding);
508 Py_FileSystemDefaultEncoding = NULL;
509 }
504 510
505 /* XXX Still allocated: 511 /* XXX Still allocated:
506 - various static ad-hoc pointers to interned strings 512 - various static ad-hoc pointers to interned strings
507 - int and float free list blocks 513 - int and float free list blocks
508 - whatever various modules and libraries allocate 514 - whatever various modules and libraries allocate