[Python-bugs-list] [Bug #133262] Incorrect encodings.py module imported

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Feb 2001 11:51:09 -0800


Bug #133262, was updated on 2001-Feb-20 08:45
Here is a current snapshot of the bug.

Project: Python
Category: Unicode
Status: Closed
Resolution: Wont Fix
Bug Group: Not a Bug
Priority: 5
Submitted by: lhudson
Assigned to : nobody
Summary: Incorrect encodings.py module imported

Details: It appears that Python/codecs.c is not importing the standard
encodings package (Lib/encodings/).

If I run an interactive interpreter in a directory containing a file
encodings.py (whose contents are:
"print 'Imported my encodings' ") then I see the following:

Python 2.1a2 (#10, Feb 19 2001, 11:05:52) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> 'Hello'.encode('utf-16')
Imported my encodings
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
LookupError: unknown encoding
>>>

Follow-Ups:

Date: 2001-Feb-20 11:51
By: fdrake

Comment:
This didn't get marked "closed", so I marked it.
-------------------------------------------------------

Date: 2001-Feb-20 10:32
By: lemburg

Comment:
This is standard Python behaviour. Modules/packages in the 
current directory always override the ones which appear later
in sys.path if there's an ''-entry starting sys.path. You will
have to rename your module, sorry.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=133262&group_id=5470