[XML-SIG] Finding _xmlplus in Python 2.3a2

M.-A. Lemburg mal@lemburg.com
Tue, 04 Mar 2003 13:45:55 +0100

Martin v. L=F6wis wrote:

Welcome bak, Martin :-) Hope you had a nice holiday !

>>> 2. A module can install additional codecs, causing changes in
>>>   behaviour to unicode_string.encode(), and codecs.lookup().
>> Additional codecs is the key thing here. Can existing codecs get=20
>> overridden?
> This is underspecified, and undocumented, but I believe you can, atleas=
> by modifying the codecs aliases.

It is undocumented on purpose: you are not supposed to override
existing codecs; you are also not supposed to hack the encodings'
package aliase table. Instead you are advised to come up with
a new name, e.g. by placing the codecs into a special package,
and registering your own search function if you want to provide
aliases for the codec.

BTW, hacking aliases is not guaranteed to always work: the codec
registry uses an internal cache which it consults *before* querying
the codec search functions. You would have to hack the aliases table
prior to first usage of the codec to be successful.

Marc-Andre Lemburg

Professional Python Software directly from the Source  (#1, Mar 04 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
Python UK 2003, Oxford:                                     28 days left
EuroPython 2003, Charleroi, Belgium:                       112 days left