A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-November/058340.html below:

[Python-Dev] reference leaks

[Python-Dev] reference leaks [Python-Dev] reference leaksWalter Dörwald walter at livinglogic.de
Fri Nov 25 10:27:55 CET 2005
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4