Trying to understand rfc822.Message() behaviour

Phoe6 orsenthil at
Thu Nov 30 19:22:17 CET 2006

Hi all,
Have  a look at this snippet, I have a file direct.txt and I want to
read it as rfc8222.Message() so that I get the Subject: and Mood: as
Dict Keys and content separately, but I am unable to get the Content

>>> fhandle = open('direct.txt','r')
>>> print
Subject: testing - fortune
Mood: happy

  "Why should we subsidize intellectual curiosity?"
  - Ronald Reagan

>>> import rfc822
>>> message = rfc822.Message(fhandle)
>>> print message
Subject: testing - fortune
Mood: happy


What is happening here. Why is the message not coming up?


More information about the Python-list mailing list