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.

classification
Title: Docs on import of email.MIMExxx classes wrong
Type: Stage:
Components: Documentation Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, hgibson50
Priority: normal Keywords:

Created on 2006-05-04 07:24 by hgibson50, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28413 - (view) Author: Hugh Gibson (hgibson50) Date: 2006-05-04 07:24
http://docs.python.org/lib/node588.html says: 

----------------------
Each of these classes should be imported from a module 
with the same name as the class, from within the email 
package. E.g.: 


import email.MIMEImage.MIMEImage

or 

from email.MIMEText import MIMEText
----------------------

However, here is a Python IDLE session showing that 
the first import format doesn't work:

----------------------
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 
32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more 
information.

<snip>
    
IDLE 1.1.3      
>>> import email.MIMEImage.MIMEImage

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in -toplevel-
    import email.MIMEImage.MIMEImage
ImportError: No module named MIMEImage
>>> 
----------------------

This method *does* work:

----------------------
>>> import email.MIMEImage
>>> 
----------------------

This got one of my inexperienced programmers tied up 
in knots!

Hugh
msg28414 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-07-28 02:36
Logged In: YES 
user_id=12800

r50890
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43319
2006-05-04 07:24:25hgibson50create