Issue 1539381: Add readinto method to StringIO and cStringIO (original) (raw)

Created on 2006-08-13 03:16 by belopolsky, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
readinto-patch.diff belopolsky,2006-08-13 03:16 diff against revision 51240
Pull Requests
URL Status Linked Edit
PR 8451 open python-dev,2018-07-24 19:43
Messages (5)
msg50876 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2006-08-13 03:16
Added a 'readonly' flag to buffer object constructor (needed to implement StringIO.readinto).
msg50877 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-08-24 23:04
Logged In: YES user_id=357491 The file object's readinto method is not meant for public use, so adding the method to StringIO is not a good idea. Sorry. Closing as rejected.
msg230550 - (view) Author: Silvio Ricardo Cordeiro (silvioricardoc) Date: 2014-11-03 19:08
BufferedReader assumes that readinto is defined, but that's not the case for StringIO's. In the end, this cripples StringIO objects, because their data can never be peek()'ed as with all other file objects.
msg322323 - (view) Author: Alan Justino (alanjds) * Date: 2018-07-24 19:07
It affects SpooledTemporaryFile too. Because it switches between StringIO, BytesIO and TemporaryFile internally. Only StringIO have not this interface. Discovered trying to `pickle.load` a remote storage file. Please reopen.
msg322327 - (view) Author: Alan Justino (alanjds) * Date: 2018-07-24 19:45
Issued a related PR (https://github.com/python/cpython/pull/8451) to allow SpooledTemporaryFile to propagate `readinto` calls to TemporaryFile, BytesIO or StringIO. Of this ones, only StringIO will fail.
History
Date User Action Args
2022-04-11 14:56:19 admin set github: 43814
2018-07-24 19:45:24 alanjds set messages: +
2018-07-24 19:43:20 python-dev set pull_requests: + <pull%5Frequest7973>
2018-07-24 19:07:02 alanjds set nosy: + alanjdsmessages: +
2014-11-03 19:08:56 silvioricardoc set versions: + Python 2.7, Python 3.2, - Python 2.6nosy: + silvioricardocmessages: + components: + IO, - Library (Lib)type: behavior
2006-08-13 03:16:10 belopolsky create