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 martin.panter
Recipients Arfrever, christian.heimes, ezio.melotti, jcea, martin.panter, sbt, skrah, vstinner
Date 2016-04-18.13:40:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460986810.65.0.0942259810746.issue15994@psf.upfronthosting.co.za>
In-reply-to
Content
I think idea 2 (error if memoryview not released) would not work. It would rely on garbage collection, which is not always immediate. E.g. if the memoryview were kept alive by a reference cycle, it may not immediately be released. I don’t think idea 3 is worthwhile, because the memoryview API does not seem designed for this use case, and it would not be 100% consistent anyway.

So that leaves my first idea, to call view.release() when readinto(), etc, return. This should avoid the crash and data loss problems in some common cases. It is implemented in release-view.patch, along with some notes.
History
Date User Action Args
2016-04-18 13:40:11martin.pantersetrecipients: + martin.panter, jcea, vstinner, christian.heimes, ezio.melotti, Arfrever, skrah, sbt
2016-04-18 13:40:10martin.pantersetmessageid: <1460986810.65.0.0942259810746.issue15994@psf.upfronthosting.co.za>
2016-04-18 13:40:10martin.panterlinkissue15994 messages
2016-04-18 13:40:10martin.pantercreate