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 vstinner
Recipients benjamin.peterson, pitrou, srid, vstinner
Date 2010-04-27.17:19:28
SpamBayes Score 0.00053772755
Marked as misclassified No
Message-id <1272388771.71.0.52121639704.issue7027@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is specific to Python 2.6. It can be reproduced with:

./python -E -tt ./Lib/test/regrtest.py -l -w test_pep263 test_operator test_asynchat test_zipimport_support test_pydoc test_code test_dis test_quopri test_doctest test_class test_sax test_fileio test_asyncore test_mailbox test_abstract_numbers test_uuid test_io test_enumerate test_property test_codecs

Or with this little test case:
----
import codecs, _codecs, sys, encodings

encoding = "cp1252"

codec = _codecs.lookup(encoding)

modname = 'encodings.%s' % encoding
__import__(modname)
del sys.modules[modname]
delattr(encodings, encoding)

encoder = codecs.getincrementalencoder(encoding)()
encoder.encode("", True)
----

module_dealloc() was modified in python trunk: the dictionary is only cleared if the reference counter is equal to 1.

/* If we are the only ones holding a reference, we can clear the dictionary. */
if (Py_REFCNT(m->md_dict) == 1) _PyModule_Clear((PyObject *)m);
History
Date User Action Args
2010-04-27 17:19:32vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, srid
2010-04-27 17:19:31vstinnersetmessageid: <1272388771.71.0.52121639704.issue7027@psf.upfronthosting.co.za>
2010-04-27 17:19:29vstinnerlinkissue7027 messages
2010-04-27 17:19:28vstinnercreate