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 serhiy.storchaka
Recipients belopolsky, izbyshev, p-ganssle, serhiy.storchaka
Date 2018-08-22.12:21:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534940485.33.0.56676864532.issue34454@psf.upfronthosting.co.za>
In-reply-to
Content
I agree, that raising UnicodeEncodeError instead of ValueError is acceptable, since the former is a subclass of the latter. But since the default implementation raises more specialized subclass, it is probably that the user code will catch more narrow exception type. Seems, it is not hard to make the same exception be raised in all cases. For example, in date_fromisoformat():

    if (!dt_ptr || len != 10
        || parse_isoformat_date(dt_ptr, &year, &month, &day) < 0)
    {
        PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dstr);
        return NULL;
    }
History
Date User Action Args
2018-08-22 12:21:25serhiy.storchakasetrecipients: + serhiy.storchaka, belopolsky, p-ganssle, izbyshev
2018-08-22 12:21:25serhiy.storchakasetmessageid: <1534940485.33.0.56676864532.issue34454@psf.upfronthosting.co.za>
2018-08-22 12:21:25serhiy.storchakalinkissue34454 messages
2018-08-22 12:21:25serhiy.storchakacreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.