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.
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