File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ def getvalue(self):
266266 8th bit) will cause a UnicodeError to be raised when getvalue()
267267 is called.
268268 """
269+ _complain_ifclosed (self .closed )
269270 if self .buflist :
270271 self .buf += '' .join (self .buflist )
271272 self .buflist = []
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ def test_iterator(self):
100100 self ._fp .close ()
101101 self .assertRaises (ValueError , self ._fp .next )
102102
103+ def test_getvalue (self ):
104+ self ._fp .close ()
105+ self .assertRaises (ValueError , self ._fp .getvalue )
106+
103107class TestStringIO (TestGenericStringIO ):
104108 MODULE = StringIO
105109
Original file line number Diff line number Diff line change @@ -382,6 +382,7 @@ Eric Huss
382382Jeremy Hylton
383383Gerhard Häring
384384Fredrik Håård
385+ Catalin Iacob
385386Mihai Ibanescu
386387Lars Immisch
387388Bobby Impollonia
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ Core and Builtins
8383Library
8484-------
8585
86+ - Issue #12161: Cause StringIO.getvalue() to raise a ValueError when used on a
87+ closed StringIO instance.
88+
8689- Issue #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
8790 division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.
8891
You can’t perform that action at this time.
0 commit comments