[Python-bugs-list] [ python-Bugs-438295 ] case of __init__.py cause strange behavi

noreply@sourceforge.net noreply@sourceforge.net
Tue, 03 Jul 2001 11:00:15 -0700


Bugs item #438295, was opened at 2001-07-03 11:00
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438295&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: case of __init__.py cause strange behavi

Initial Comment:
I accidently created the file __INIT__.PY in my 'krw' 
package directory (WinNT4).  Everything appeared to 
work as it should, except I was getting a very strange 
AttributeError:

Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license" for more 
information.
>>> import printerTable
>>> l = printerTable.buildFromServer( 'chachaptr1')
>>> l = printerTable.buildFromServer( 'chachaptr1')
>>> l = printerTable.buildFromServer( 'chachaptr1')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "printerTable.py", line 57, in buildFromServer
    host = krw.util.Host( hostAndPort[0])
AttributeError: '?' module has no attribute 'util'

At this point:

dir( printerTable.krw) => []

After 2 days trying to find out what was happening in 
the code, I decided to check out the package.  I ended 
up recreating the file as __init__.py and the problem 
went away.

I can rename the file back to __INIT__.PY and it 
produces the behavior mentioned above.


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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438295&group_id=5470