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 belopolsky, georg.brandl, jcea, lemburg, mark.dickinson, ncoghlan, pitrou
Date 2011-02-23.15:22:38
SpamBayes Score 2.8380774e-07
Marked as misclassified No
Message-id <1298474556.3710.54.camel@localhost.localdomain>
In-reply-to <1298474131.25.0.33633579283.issue11286@psf.upfronthosting.co.za>
Content
> It may be better to modify _Unpickler_Read() so that it returns
> self->input_buffer (or even self->input_buffer + self->next_read_idx)
> for zero n.

I agree this would be better for readability and maintainability.

> On the other hand, my patch also eliminates redundant call to
> _Unpickler_Read() and makes load_binstring() and
> load_short_binstring() logic similar to that in load_counted_long().
> The main advantage, of course is skipping PyUnicode_Decode() which
> will load a codec potentially triggering an import and execution of
> python code.

Well, a theoretical argument could be made that some codec could return
a non-empty string when asked to decode an empty bytestring, but I'm not
sure it has much practical worth :)
History
Date User Action Args
2011-02-23 15:22:40pitrousetrecipients: + pitrou, lemburg, georg.brandl, jcea, mark.dickinson, ncoghlan, belopolsky
2011-02-23 15:22:38pitroulinkissue11286 messages
2011-02-23 15:22:38pitroucreate