My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 3: Wrong handling of strings in _convert_datetime
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  May 2011


 
Reported by thomas.j...@gmail.com, Nov 17, 2009
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.
feedformatter-correct_datetime.patch
1.4 KB   View   Download
May 6, 2011
Project Member #1 michael5...@gmail.com
I noticed this issue as well.  Thanks for the patch, it works for me.

Any chance of getting this merged into the distribution?  The version I pulled down from pypi has this bug.
May 6, 2011
Project Member #2 michael5...@gmail.com
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.
feedformatter-correct_datetime02.patch
1.5 KB   View   Download
May 7, 2011
Project Member #3 michael5...@gmail.com
This issue was closed by revision r15.
Status: Fixed

Powered by Google Project Hosting