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/2009-May/089496.html below:

[Python-Dev] PEP 383 update: utf8b is now the error handler

[Python-Dev] PEP 383 update: utf8b is now the error handler [Python-Dev] PEP 383 update: utf8b is now the error handlerMRAB google at mrabarnett.plus.com
Thu May 7 17:08:49 CEST 2009
Walter Dörwald wrote:
> Michael Urman wrote:
> 
>> [...]
>>> Well, there is a way to stack error handlers, although it's not pretty:
>>> [...]
>>> codecs.register_error("surrogates_then_replace",
>>>                      surrogates_then_replace)
>> That mitigates my arguments significantly, although I'd rather see
>> something like errors=('surrogates', 'replace') chain the handlers
>> without additional registrations. But that's a different PEP or
>> arbitrary change. :)
> 
> The first version of PEP 293 changed the errors argument to be a string
> or callable. This would have simplified handler stacking somewhat
> (because you don't have to register or lookup handlers) but it had the
> disadvantage that many "char *" arguments in the C API would have had to
> changed to "PyObject *". Changing the errors argument to a list of
> strings would have the same problem.
> 
A comma-separated or space-separated string, eg 'surrogates replace' or
'surrogates,replace'? It could be treated as handler stacking
internally.
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