Bugs item #1569084, was opened at 2006-10-02 08:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1569084&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivan Vilata i Balaguer (ivilata)
Assigned to: M.-A. Lemburg (lemburg)
Summary: External codecs no longer usable

Initial Comment:
Up to Python 2.5, external codec packages could be used
just by dropping them somewhere in the $PYTHONPATH, as
long as they provided a ``getregentry()`` function and
the normalised encoding name matched the name of the
package.  For instance, having a ``myencoding`` package
with a ``getregentry()`` function in it made possible
executing::

    >>> u'something'.encode('myencoding')

without even importing ``myencoding``.  It was the
``__import__(modname, ...)`` statement in
``encodings.search_function()`` which made this possible.

However, in Python 2.5 the previous statement was
changed to the absolute one ``__import('encodings.' +
modname, ...)``, which makes external codec packages no
longer reachable in the way described above.  Is this a
bug, or has this been made on purpose?  In the later
case, what do you recommend to use external codecs as
transparently as possible?  I now manually enter the
registry tuple/CodecInfo into the encodings cache, but
tampering with it doesn't seem right (and it also means
that some initialisation code must be explicitly run).

By the way, this bug may be related with #223642. 
Maybe it should be reopened.

Thank you very much!

(I know, I should have checked the betas and release
candidates in case this was a bug.  I didn't have the
time, sorry!)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1569084&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to