codecs limitation

Denis S. Otkidach ods at strana.ru
Wed Feb 18 09:20:38 EST 2004


Exploring the idea of Ian Bicking to define web codecs
(http://blog.colorstudy.com/ianb/weblog/2003/11/06.html#P29) I've
noticed that encoder can't return unicode string.  Here is
corresponding lines of code from Objects/unicodeobject.c:
--->8---
    /* XXX Should we really enforce this ? */
    if (!PyString_Check(v)) {
        PyErr_Format(PyExc_TypeError,
                     "encoder did not return a string object
(type=%.400s)",
                     v->ob_type->tp_name);
--->8---

I have the same question as stated in comments: should we really
enforce this and forget the idea to define some specialized
encodings like 'html'?

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]





More information about the Python-list mailing list