Atttribute error

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue May 8 12:37:26 EDT 2007


In <1178641784.974581.14000 at p77g2000hsh.googlegroups.com>, HMS Surprise
wrote:

> The snippet below causes an attribute error.
> 
> AttributeError: module 'urllib' has no attribute 'urlopen'
> 
> I am using python 2.2.3. According to the documentation at C:
> \Python22\Doc\lib urllib has a function called urlopen.

Do you have a file called `urllib.py` in the current directory?  Then this
gets imported instead of the module in the standard library.

Add this directly after the ``import`` to see what's happening:

print urllib.__file__
print dir(urllib)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list