➜

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.

作者 ncoghlan
收信人 doerwalter, ezio.melotti, lemburg, ncoghlan, python-dev, serhiy.storchaka, vstinner
日期 2013-11-23.02:20:14
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1385173214.47.0.135960158308.issue19619@psf.upfronthosting.co.za>
In-reply-to
内容
The examples from the 3.4 What's New may make it clearer why the exception wrapping in the codec machinery is much broader in scope that just detecting output type errors (even though handling that case was the original motivation for the idea):

    >>> import codecs

    >>> codecs.decode(b"abcdefgh", "hex")
    binascii.Error: Non-hexadecimal digit found

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    binascii.Error: decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)

    >>> codecs.encode("hello", "bz2")
    TypeError: 'str' does not support the buffer interface

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: encoding with 'bz2' codec failed (TypeError: 'str' does not support the buffer interface)
历史
日期 用户 动作 参数
2013-11-23 02:20:14ncoghlan修改recipients: + ncoghlan, lemburg, doerwalter, vstinner, ezio.melotti, python-dev, serhiy.storchaka
2013-11-23 02:20:14ncoghlan修改messageid: <1385173214.47.0.135960158308.issue19619@psf.upfronthosting.co.za>
2013-11-23 02:20:14ncoghlan链接issue19619 messages
2013-11-23 02:20:14ncoghlan创建