Message129207
> 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 :) |
|
Date |
User |
Action |
Args |
2011-02-23 15:22:40 | pitrou | set | recipients:
+ pitrou, lemburg, georg.brandl, jcea, mark.dickinson, ncoghlan, belopolsky |
2011-02-23 15:22:38 | pitrou | link | issue11286 messages |
2011-02-23 15:22:38 | pitrou | create | |
|