[Python-Dev] Decoding incomplete unicode (original) (raw)

M.-A. Lemburg mal at egenix.com
Thu Aug 19 11:41:51 CEST 2004


Martin v. Löwis wrote:

We do need to extend the API between the stream codec and the encode/decode functions, no doubt about that. However, this is an extension that is well hidden from the user of the codec and won't break code.

So you agree to the part of Walter's change that introduces new C functions (PyUnicodeDecodeUTF7Stateful etc)?

We'll have to see... all this is still very much brainstorming.

I think most of the patch can be discarded: there is no need for .encode and .decode to take an additional argument. It is only necessary that the StreamReader and StreamWriter are stateful, and that only for a selected subset of codecs.

Marc-Andre, if the original patch (diff.txt) was applied: What specific change in that patch would break code? What specific code (C or Python) would break under that change? I believe the original patch can be applied as-is, and does not cause any breakage. It also introduces a change between the codec and the encode/decode functions that is well hidden from the user of the codec.

Let's flesh this out some more and get a better understanding of what is needed and how the separation between the stream queue, the stream codec and the underlying codec implementation can be put to good use.

-- Marc-Andre Lemburg eGenix.com

Professional Python Services directly from the Source (#1, Aug 19 2004)

Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Python-Dev mailing list