Neal Norwitz wrote: > [...] > #### test_codeccallbacks > > import codecs > def test_callbacks(): > def handler(exc): > l = [u"<%d>" % ord(exc.object[pos]) for pos in xrange(exc.start, exc.end)] > return (u"[%s]" % u"".join(l), exc.end) > codecs.register_error("test.handler", handler) > # the {} is necessary to cause the leak, {} can hold data too > codecs.charmap_decode("abc", "test.handler", {}) > > test_callbacks() > # leak from PyUnicode_DecodeCharmap() each time test_callbacks() is called
Can you move the call to codecs.register_error() out of test_callbacks() and retry? Bye, Walter Dörwald _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com