[Python-ideas] Add "htmlcharrefreplace" error handler

M.-A. Lemburg mal at egenix.com
Fri Jun 14 15:55:52 CEST 2013


On 14.06.2013 14:39, Amaury Forgeot d'Arc wrote:
> 2013/6/14 Antoine Pitrou <solipsis at pitrou.net>
> 
>> Making registration manual would indeed be a better fit for the
>> intended use cases, IMO. I don't think such a specialized function
>> belongs to the built-in set of error handlers.
>>
> 
> By the way, why is it necessary to register?
> Since an error handler is defined by its callback function,
> we could allow functions for the "errors" parameter.

For the same reason we register modules in sys.modules:
to be able to reference them by name, rather than by object.

Also note that codecs expect to get the error parameter as string
to keep the API simple and to make short-cuts easy to implement
in the code (esp. in the C implementations).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 14 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2013-07-01: EuroPython 2013, Florence, Italy ...           17 days to go
2013-07-16: Python Meeting Duesseldorf ...                 32 days to go

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-ideas mailing list