A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/048022.html below:

[Python-Dev] Decoding incomplete unicode

[Python-Dev] Decoding incomplete unicode [Python-Dev] Decoding incomplete unicode"Martin v. Löwis" martin at v.loewis.de
Wed Aug 18 22:39:22 CEST 2004
Walter Dörwald wrote:
>>   But then incompleteness is always OK,
>    because the StreamReader can't distinguish a temporarily
>    exhausted input stream from a permanently exhausted one.
>    The only fix for this I can think of is the final argument.

I don't think the final argument is needed. Methinks that the
.encode/.decode should not be used by an application. Instead,
applications should only use the file API on a reader/writer.

If so, stateful readers/writers can safely implement
encode/decode to take whatever state they have into account,
creating new state as they see fit.

Of course, stateful writers need to implement their own .close function,
which flushes the remaining bytes, and need to make sure that .close
is automatically invoked if the object goes away.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4