Closed GoogleCodeExporter closed 9 years ago
This is obviously a problem. I'm going to have to think about how to handle
this so that users aren't affected by this when they upgrade, but without
introducing a convenience mapping that developers come to rely on.
Original comment by kurtmckee
on 12 Feb 2012 at 6:18
One idea would be to issue a warning, deprecate that behavior and make the
warning message clearly state that this deprecated behavior will be removed
e.g. at the release that happens at earliest one year from the release date of
the version in which the deprecation was introduced.
http://docs.python.org/library/warnings.html
Just an idea, I'm sure you can come up with something clever :)
Original comment by th.perl@gmail.com
on 13 Feb 2012 at 8:53
I don't come up with clever things, I just club things together until they
work, heh. I had been thinking a warning might be appropriate, so I'll take
your suggestion as confirmation that that's probably the right path to pursue!
Original comment by kurtmckee
on 13 Feb 2012 at 8:58
This issue was closed by revision r689.
Original comment by kurtmckee
on 19 Feb 2012 at 9:50
Okay, here's how this works (and this applies to both `updated` and
`updated_parsed` in both `f.feed` and `f.entries[i]`):
If `published` and `updated` keys both exist, they'll function as expected.
If, however, `updated` doesn't exist but `published` does, membership tests
like `'updated' in f.feed` will return False. Then, if the `updated` key is
deliberately accessed, the value of `published` will be returned. Additionally,
the warnings module will throw a DeprecationWarning which won't by default
trigger an exception nor a traceback. This behavior can be modified by calling
some of the methods in the warnings module or by starting the Python
interpreter with the -W switch, but under normal circumstances the
DeprecationWarning will only be printed once and won't trigger an exception.
Although I updated the documentation and added unit tests to help ensure that
this is behaving well, if I missed something please please please ping me back
about it. It's my intention to release feedparser 5.1.1 to accommodate several
Linux distribution maintainers, but I want to make sure this is done correctly.
:)
Thanks for reporting this, Thomas!
Original comment by kurtmckee
on 19 Feb 2012 at 10:11
published
when updated
is not available (see issue 310)
Original issue reported on code.google.com by
th.perl@gmail.com
on 12 Feb 2012 at 11:26