127.0.0.1.2013-05-29.14-41-05.3b4f5f26-486e-4094-b32e-838d2bedd4e5
| web2py™ | Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 |
|---|---|
| Python | Python 2.7.3: C:\Python27\python.exe (prefix: C:\Python27) |
1. | Traceback (most recent call last): |
127.0.0.1.2013-05-29.14-49-25.63d546c2-feb6-43e4-b6f2-0cb4fc6bb022
| web2py™ | Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 |
|---|---|
| Python | Python 2.7.3: C:\Python27\python.exe (prefix: C:\Python27) |
1. | Traceback (most recent call last): |
--
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/8ZwVMKS69Sg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'm currently using python 2.7.3
Should I update to the latest 2.7.5 to get this work ?
--
| web2py™ | Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 |
|---|---|
| Python | Python 2.7.5: C:\Python27\python.exe (prefix: C:\Python27) |
1. |
Traceback (most recent call last |
): |
from gluon.serializers import rss}}{{=XML(rss(response._vars |
))}} |
|
def rss(feed):
if not 'entries' in feed and 'items' in feed:
feed['entries'] = feed['items']
now = datetime.datetime.now()
try:
rss = rss2.RSS2(title=str(feed.get('title', '(notitle)').encode('utf-8', 'replace')),
link=str(feed.get('link', None).encode('utf-8', 'replace')),
description=str(feed.get('description', '').encode('utf-8', 'replace')),
lastBuildDate=feed.get('created_on', now),
items=[rss2.RSSItem(
title=str(entry.get('title', '(notitle)').encode('utf-8', 'replace')),
link=str(entry.get('link', None).encode('utf-8', 'replace')),
description=str(entry.get('description', '').encode('utf-8', 'replace')),
pubDate=entry.get('created_on', now)
) for entry in feed.get('entries', [])])
except Exception: #if an exception is raised, we use the former methon which works fine
rss = rss2.RSS2(title=str(feed.get('title', '(notitle)')),
link=str(feed.get('link', None)),
description=str(feed.get('description', '')),
lastBuildDate=feed.get('created_on', now),
items=[rss2.RSSItem(
title=str(entry.get('title', '(notitle)')),
link=str(entry.get('link', None)),
description=str(entry.get('description', '')),
pubDate=entry.get('created_on', now)
) for entry in feed.get('entries', [])])
return rss.to_xml(encoding='utf-8')127.0.0.1.2013-06-02.14-13-25.c9feb7ca-4163-463e-ad44-185a7141dc9d
| web2py™ | Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 |
|---|---|
| Python | Python 2.7.5: C:\Python27\python.exe (prefix: C:\Python27) |
1. | Traceback (most recent call last): |
def rss(feed): if not 'entries' in feed and 'items' in feed: feed['entries'] = feed['items'] now = datetime.datetime.now() rss = rss2.RSS2(title=feed.get('title', '(notitle)'), link=feed.get('link', None), description=feed.get('description', ''), lastBuildDate=feed.get('created_on', now), items=[rss2.RSSItem( title=entry.get('title', '(notitle)'), link=entry.get('link', None), description=entry.get('description', ''), pubDate=entry.get('created_on', now) ) for entry in feed.get('entries', [])]) return rss.to_xml(encoding='utf-8')