Message187384
_PyBytesWriter and _PyUnicodeWriter have differen use cases. While _PyUnicodeWriter used primary in formatter where resulting size is rarely known and reallocation in decoders usually caused by widening result, _PyBytesWriter is used only in decoders where we usually can estimate a result size or it's upper bound. Resizing happened only in exceptional cases, when error handler called.
The patch contains a special case for writing only one bytes object. This is very unlikely case. It happened only when an encoded string contains only one illegal character. I think this case is not worth a complication and
obfuscation of the code. I think we should drop readonly attribute and a piece of the code (which looks buggy for me anyway). |
|
| Date |
User |
Action |
Args |
| 2013-04-19 20:18:53 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
| 2013-04-19 20:18:53 | serhiy.storchaka | set | messageid: <1366402733.56.0.391953444227.issue17742@psf.upfronthosting.co.za> |
| 2013-04-19 20:18:53 | serhiy.storchaka | link | issue17742 messages |
| 2013-04-19 20:18:53 | serhiy.storchaka | create | |
|