I had asked Marc-Andre Lemburg(author of codec module in python) whether you can override an inbuilt codec, and his reply:
It's not really supported to override builtin codecs via a search
function. The only way is to monkey patch the encodings package
module implementing the codec and then only if you manage to
implement this patching before the codec gets used for the first
time, since the codec subsystem uses a cache for codecs to improve
performance.
Note that the codec search function registry is mainly meant to
*add* new codecs, not to override existing ones.
see: https://github.com/komuw/naz/blob/8b1ec3d0724e0d86bdfa3b804261600bea65d82e/tests/test_codec.py#L177-L232
I had asked
Marc-Andre Lemburg
(author of codec module in python) whether you can override an inbuilt codec, and his reply:This was via email.
We should re-architect based on this new info.