[IronPython] IronPython Community Edition - FeedParser Weirdness

Tim Riley riltim at gmail.com
Thu Dec 27 19:51:57 CET 2007


I am trying to access my gmail account using the latest IronPython
Community Edition (IPY, not IPY2) and the python feedparser library.
When I run the following script through python 2.5 everything works
great, however when I run it through ipy.exe I get an error. I was
wondering if anyone has any experience using feedparser with ipy and
if so if they could give me a pointer on how to get this working.


Here is the code:

#################code#####################
#Note: Build with IronPython Community Edition, Not Standard IronPython

#import statements
import ConfigParser
import feedparser


def generateURL():
    """
    Generates a the url for the ATOM feed by reading the username and
password from the config file.
    """
    config = ConfigParser.ConfigParser()
    config.read("config.ini")
    return "https://%s:%s@gmail.google.com/gmail/feed/atom" %
(config.get("app:main", "username"), config.get("app:main",
"password"))


def checkmail():
    usermail = feedparser.parse(generateURL())
    #for testing only
    print usermail.feed.title
    print len(usermail['entries'])

if __name__ == "__main__":
    checkmail()
#################code#####################


and here is the output:

################output####################



C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py
Gmail - Inbox for riltim at gmail.com
9

C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py
Traceback (most recent call last):
  File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l
ine 25, in Initialize
  File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l
ine 20, in checkmail
AttributeError: title

################output####################



More information about the Ironpython-users mailing list