This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gtk
Recipients
Date 2001-04-21.15:09:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=59803

Yet another demonstration case: 

DemonstratePydocBug/TryThis.py: 

    import DemonstratePydocBug.Target 
    Target = DemonstratePydocBug.Target

This gives us a local Target variable, same as 'from 
DemonstratePydocBug import Target'. Pydoc barfs on this on 
the very first load. The traceback I hacked into pydoc 
claims:

Traceback (most recent call last):

  File "C:\Python21\Lib\pydoc.py", line 223, in safeimport
    module = __import__(path)

  File "c:\python21\lib\DemonstratePydocBug\TryThis.py", 
line 9, in ?
    Target = DemonstratePydocBug.Target

AttributeError: 'DemonstratePydocBug' module has no 
attribute 'Target'

In the interpreter, everything's fine with both techniques 
for getting Target: 

C:\Python21\thirdparty\MoinMoin>python
Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license" for more 
information.
>>> from DemonstratePydocBug import Target
>>> Target
<module 'DemonstratePydocBug.Target' from 'c:\python21
\lib\DemonstratePydocBug\Target.pyc'>
>>> 

C:\Python21\thirdparty\MoinMoin>python
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 DemonstratePydocBug.Target
>>> Target = DemonstratePydocBug.Target
>>> Target
<module 'DemonstratePydocBug.Target' from 'c:\python21
\lib\DemonstratePydocBug\Target.pyc'>
>>> 
History
Date User Action Args
2007-08-23 13:54:00adminlinkissue417833 messages
2007-08-23 13:54:00admincreate