[New-bugs-announce] [issue3712] memoryview leaks references

Amaury Forgeot d'Arc report at bugs.python.org
Thu Aug 28 13:01:49 CEST 2008

New submission from Amaury Forgeot d'Arc <amauryfa at gmail.com>:

Two problems with memoryview:
- The buffer interface of memoryview leaks a reference:
    str(memoryview(b'text'), 'utf-8')

- memoryview does not implement tp_traverse and tp_clear, so reference
cycle cannot be collected, as with:

import gc
class MyBuf(bytes): pass

def f():
    buf = MyBuf(b'abc')
    m = memoryview(buf)
    buf.m = m

each call to f() leaks 6 references.

messages: 72078
nosy: amaury.forgeotdarc
priority: release blocker
severity: normal
status: open
title: memoryview leaks references
versions: Python 3.0

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list