[pypy-commit] [Git][pypy/pypy][branch/default] 3 commits: Check whether stream is closed in BufferedMixin.truncate_w().

Matti Picus foss at heptapod.net
Mon Aug 24 01:42:48 EDT 2020



Matti Picus pushed to branch branch/default at PyPy / pypy


Commits:
02d287ec by Manuel Jacob at 2020-03-08T02:21:14+01:00
Check whether stream is closed in BufferedMixin.truncate_w().

Before this, the method was failing later on a closed stream when accessing the
underlying raw stream. It is more consistent and robust to check for a closed
stream earlier.

Starting with the next changeset, closing the stream will set the buffer to
None. Given that the buffer is potentially accessed by truncate_w(), it is
a very good idea to check that the stream is not closed, although it is hard
to make truncate_w() actually access the buffer when the stream is closed
(because closing it will flush the unwritten data from the buffer).

- - - - -
8d022e19 by Manuel Jacob at 2020-03-07T23:08:57+01:00
Set buffer of buffered IO classes to None in close().

This helps to reclaim the memory used by the buffer earlier.

- - - - -
6a51a223 by Matti Picus at 2020-08-24T05:42:43+00:00
Merge branch 'topic/default/bufferedio-release-buffer' into 'branch/default'

Set buffer to None on close of buffered io classes

See merge request pypy/pypy!711

- - - - -


2 changed files:

- pypy/module/_io/interp_bufferedio.py
- pypy/module/_io/test/test_bufferedio.py


View it on GitLab: https://foss.heptapod.net/pypy/pypy/-/compare/f2f7b5a07bfc05e70e4c6f67dfbcca545313611f...6a51a223d9d60810b72c4a2888cad25d19390fbc

-- 
View it on GitLab: https://foss.heptapod.net/pypy/pypy/-/compare/f2f7b5a07bfc05e70e4c6f67dfbcca545313611f...6a51a223d9d60810b72c4a2888cad25d19390fbc
You're receiving this email because of your account on foss.heptapod.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-commit/attachments/20200824/2c43b2e0/attachment-0001.html>


More information about the pypy-commit mailing list