Message148111
| Author |
vstinner |
| Recipients |
ezio.melotti, loewis, skrah, vstinner |
| Date |
2011年11月22日.12:24:47 |
| SpamBayes Score |
6.1062266e-16 |
| Marked as misclassified |
No |
| Message-id |
<1321964689.08.0.0221252575292.issue13452@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Error handling of PyUnicode_EncodeDecimal() is broken by design. The caller cannot know the size of the output buffer because each error handler produce a variable output, whereas the caller has to allocate
this buffer and it is not possible to specify the size of the output buffer.
I propose to raise a ValueError if the error handler is different than "strict" and do this change in Python 2.7, 3.2 and 3.3.
In Python 2.7 code base, PyUnicode_EncodeDecimal() is always called with
errors=NULL. In Python 3.x, the function is no more called.
Attached patch is for Python 3.2.
See also the issue #13093. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年11月22日 12:24:49 | vstinner | set | recipients:
+ vstinner, loewis, ezio.melotti, skrah |
| 2011年11月22日 12:24:49 | vstinner | set | messageid: <1321964689.08.0.0221252575292.issue13452@psf.upfronthosting.co.za> |
| 2011年11月22日 12:24:48 | vstinner | link | issue13452 messages |
| 2011年11月22日 12:24:48 | vstinner | create |
|