| Issue 3: | Wrong handling of strings in _convert_datetime |
‹ Prev
2 of 2
|
| 1 person starred this issue and may be notified of changes. | Back to list |
I'm trying to read a RSS feed with feedparser and update it with
feedformatter to add a few entries in it.
When creating the output file, feedformatter fails with the following message:
File "/usr/lib/python2.6/site-packages/feedformatter.py", line 163, in
_convert_datetime
raise Exception("Unrecongised time format!")
The string that it can't convert is an Unicode string previously created
with feedformatter. It's something like "Tue, 17 Nov 2009 15:21:46 CET",
which is *not* alphanumeric, so "time.isalnum()" fails. (And since
"strptime()" is not imported from the "time" module, it wouldn't work anyway.)
Here is a patch that fixes this bad behaviour. It also uses
types.StringTypes for a (possibly) better Unicode support.
May 6, 2011
Project Member
#1
michael5...@gmail.com
May 6, 2011
Actually, I had one more thing I need as well. The _convert_datetime() function doesn't allow one to pass in a python datetime.datetime object, which is a little inconvenient. So here's another patch (which incorporates the previous patch) to add datetime support. |