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 pitrou
Recipients Arfrever, alexandre.vassalotti, asvetlov, neologix, pitrou, rhettinger, serhiy.storchaka
Date 2013-04-26.21:45:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367012712.2558.2.camel@fsol>
In-reply-to <1367012542.84.0.428648045906.issue17810@psf.upfronthosting.co.za>
Content
> What if just use io.BufferedReader?
> 
>     if not isinstance(file, io.BufferedReader):
>         file = io.BufferedReader(file)
> 
> (at start of _Unpickler.__init__)

Two problems:

1. semantically, it is wrong; the BufferedReader will read bytes beyond
the pickle end, so the underlying stream will be desynchronized

2. performance-wise, it doesn't solve the issue either: read() method
calls are costly, even on an optimized C object
History
Date User Action Args
2013-04-26 21:45:14pitrousetrecipients: + pitrou, rhettinger, alexandre.vassalotti, Arfrever, asvetlov, neologix, serhiy.storchaka
2013-04-26 21:45:14pitroulinkissue17810 messages
2013-04-26 21:45:14pitroucreate