diff --git a/LICENSE b/LICENSE index f1bc4b55..70b8167f 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ feedparser and its unit tests are released under the following license: ----- begin license block ----- -Copyright (C) 2010-2021 Kurt McKee +Copyright (C) 2010-2022 Kurt McKee Copyright (C) 2002-2008 Mark Pilgrim All rights reserved. @@ -38,7 +38,7 @@ released under the following license: ----- begin license block ----- -Copyright (C) 2010-2021 Kurt McKee +Copyright (C) 2010-2022 Kurt McKee Copyright (C) 2004-2008 Mark Pilgrim. All rights reserved. Redistribution and use in source (Sphinx ReST) and "compiled" forms (HTML, PDF, diff --git a/NEWS b/NEWS index 1339cf07..2b39e7e2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ coming in the next release: +6.0.10 - 21 May 2022 + * Populate ```` correctly if it comes after ````. (#260) + 6.0.9 - 19 May 2022 * Fix a crash that can occur with GeoRSS feeds that lack a ```` tag. (#305) diff --git a/README.rst b/README.rst index 9406aeaf..8b64e625 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ feedparser - Parse Atom and RSS feeds in Python. -| Copyright 2010-2021 Kurt McKee +| Copyright 2010-2022 Kurt McKee | Copyright 2002-2008 Mark Pilgrim feedparser is open source. See the LICENSE file for more information. diff --git a/docs/conf.py b/docs/conf.py index 4bd1ba37..92efb452 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,7 @@ # project information project = 'feedparser' -copyright = '2010-2021 Kurt McKee, 2004-2008 Mark Pilgrim' +copyright = '2010-2022 Kurt McKee, 2004-2008 Mark Pilgrim' language = 'en' # documentation options diff --git a/docs/license.rst b/docs/license.rst index 1f8c789d..46943f0f 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -3,7 +3,7 @@ Documentation license ===================== -Copyright 2010-2021 Kurt McKee, 2004-2008 Mark Pilgrim. All rights reserved. +Copyright 2010-2022 Kurt McKee, 2004-2008 Mark Pilgrim. All rights reserved. Redistribution and use in source (Sphinx ReST) and "compiled" forms (HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted diff --git a/dodo.py b/dodo.py index 59870cf8..22da22c3 100644 --- a/dodo.py +++ b/dodo.py @@ -1,5 +1,5 @@ # This file is part of feedparser. -# Copyright 2020-2021 Kurt McKee +# Copyright 2020-2022 Kurt McKee # Released under the BSD 2-clause license. # The tasks defined in this file automates the entire diff --git a/feedparser/__init__.py b/feedparser/__init__.py index 2e73bfa7..1e8877c0 100644 --- a/feedparser/__init__.py +++ b/feedparser/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # @@ -32,7 +32,7 @@ __author__ = 'Kurt McKee ' __license__ = 'BSD 2-clause' -__version__ = '6.0.9' +__version__ = '6.0.10' # HTTP "User-Agent" header to send to servers when downloading feeds. # If you are embedding feedparser in a larger application, you should diff --git a/feedparser/api.py b/feedparser/api.py index 837cde15..aed3f479 100644 --- a/feedparser/api.py +++ b/feedparser/api.py @@ -1,5 +1,5 @@ # The public API for feedparser -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/__init__.py b/feedparser/datetimes/__init__.py index f33bb6c7..21487a0f 100644 --- a/feedparser/datetimes/__init__.py +++ b/feedparser/datetimes/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/asctime.py b/feedparser/datetimes/asctime.py index 8e651776..c4b16249 100644 --- a/feedparser/datetimes/asctime.py +++ b/feedparser/datetimes/asctime.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/greek.py b/feedparser/datetimes/greek.py index 63329235..7f433fed 100644 --- a/feedparser/datetimes/greek.py +++ b/feedparser/datetimes/greek.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/hungarian.py b/feedparser/datetimes/hungarian.py index df18fe13..691a6ebc 100644 --- a/feedparser/datetimes/hungarian.py +++ b/feedparser/datetimes/hungarian.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/iso8601.py b/feedparser/datetimes/iso8601.py index 2fe47091..b7463a52 100644 --- a/feedparser/datetimes/iso8601.py +++ b/feedparser/datetimes/iso8601.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/korean.py b/feedparser/datetimes/korean.py index 6af7a030..788d4666 100644 --- a/feedparser/datetimes/korean.py +++ b/feedparser/datetimes/korean.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/perforce.py b/feedparser/datetimes/perforce.py index 1a8aff10..d52a838b 100644 --- a/feedparser/datetimes/perforce.py +++ b/feedparser/datetimes/perforce.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/rfc822.py b/feedparser/datetimes/rfc822.py index ceb40967..871e18fd 100644 --- a/feedparser/datetimes/rfc822.py +++ b/feedparser/datetimes/rfc822.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/datetimes/w3dtf.py b/feedparser/datetimes/w3dtf.py index 28577b59..6fb2c545 100644 --- a/feedparser/datetimes/w3dtf.py +++ b/feedparser/datetimes/w3dtf.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/encodings.py b/feedparser/encodings.py index 6260f29f..f939f468 100644 --- a/feedparser/encodings.py +++ b/feedparser/encodings.py @@ -1,5 +1,5 @@ # Character encoding routines -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/exceptions.py b/feedparser/exceptions.py index b1f5c60a..3a022811 100644 --- a/feedparser/exceptions.py +++ b/feedparser/exceptions.py @@ -1,5 +1,5 @@ # Exceptions used throughout feedparser -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/html.py b/feedparser/html.py index 9728fb0c..3ffa9b88 100644 --- a/feedparser/html.py +++ b/feedparser/html.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/http.py b/feedparser/http.py index 92f69455..9d441038 100644 --- a/feedparser/http.py +++ b/feedparser/http.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/mixin.py b/feedparser/mixin.py index 49db2be8..74542369 100644 --- a/feedparser/mixin.py +++ b/feedparser/mixin.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # @@ -193,6 +193,7 @@ def __init__(self): self.svgOK = 0 self.title_depth = -1 self.depth = 0 + self.hasContent = 0 if self.lang: self.feeddata['language'] = self.lang.replace('_', '-') diff --git a/feedparser/namespaces/_base.py b/feedparser/namespaces/_base.py index 6af9c43a..6478a76c 100644 --- a/feedparser/namespaces/_base.py +++ b/feedparser/namespaces/_base.py @@ -1,5 +1,5 @@ # Support for the Atom, RSS, RDF, and CDF feed formats -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # @@ -259,6 +259,7 @@ def _start_item(self, attrs_d): def _end_item(self): self.pop('item') self.inentry = 0 + self.hasContent = 0 _end_entry = _end_item def _start_language(self, attrs_d): @@ -388,7 +389,7 @@ def _end_title(self): def _start_description(self, attrs_d): context = self._get_context() - if 'summary' in context: + if 'summary' in context and not self.hasContent: self._summaryKey = 'content' self._start_content(attrs_d) else: @@ -429,7 +430,7 @@ def _end_generator(self): def _start_summary(self, attrs_d): context = self._get_context() - if 'summary' in context: + if 'summary' in context and not self.hasContent: self._summaryKey = 'content' self._start_content(attrs_d) else: @@ -466,6 +467,7 @@ def _end_source(self): self.sourcedata.clear() def _start_content(self, attrs_d): + self.hasContent = 1 self.push_content('content', attrs_d, 'text/plain', 1) src = attrs_d.get('src') if src: @@ -477,6 +479,7 @@ def _start_body(self, attrs_d): _start_xhtml_body = _start_body def _start_content_encoded(self, attrs_d): + self.hasContent = 1 self.push_content('content', attrs_d, 'text/html', 1) _start_fullitem = _start_content_encoded diff --git a/feedparser/namespaces/admin.py b/feedparser/namespaces/admin.py index 39d986eb..74218348 100644 --- a/feedparser/namespaces/admin.py +++ b/feedparser/namespaces/admin.py @@ -1,5 +1,5 @@ # Support for the administrative elements extension -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/cc.py b/feedparser/namespaces/cc.py index 53eccf72..6735c5fe 100644 --- a/feedparser/namespaces/cc.py +++ b/feedparser/namespaces/cc.py @@ -1,5 +1,5 @@ # Support for the Creative Commons licensing extensions -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/dc.py b/feedparser/namespaces/dc.py index 2c827747..a89221d2 100644 --- a/feedparser/namespaces/dc.py +++ b/feedparser/namespaces/dc.py @@ -1,5 +1,5 @@ # Support for the Dublin Core metadata extensions -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/georss.py b/feedparser/namespaces/georss.py index 62605f01..786a926f 100644 --- a/feedparser/namespaces/georss.py +++ b/feedparser/namespaces/georss.py @@ -1,5 +1,5 @@ # Support for the GeoRSS format -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/itunes.py b/feedparser/namespaces/itunes.py index cbf30af4..a50a0ea8 100644 --- a/feedparser/namespaces/itunes.py +++ b/feedparser/namespaces/itunes.py @@ -1,5 +1,5 @@ # Support for the iTunes format -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/mediarss.py b/feedparser/namespaces/mediarss.py index e2ad2cae..2298ad2f 100644 --- a/feedparser/namespaces/mediarss.py +++ b/feedparser/namespaces/mediarss.py @@ -1,5 +1,5 @@ # Support for the Media RSS format -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/namespaces/psc.py b/feedparser/namespaces/psc.py index 97af3346..a440bd68 100644 --- a/feedparser/namespaces/psc.py +++ b/feedparser/namespaces/psc.py @@ -1,5 +1,5 @@ # Support for the Podlove Simple Chapters format -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/parsers/loose.py b/feedparser/parsers/loose.py index 620aeb57..d6c97e10 100644 --- a/feedparser/parsers/loose.py +++ b/feedparser/parsers/loose.py @@ -1,5 +1,5 @@ # The loose feed parser that interfaces with an SGML parsing library -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/parsers/strict.py b/feedparser/parsers/strict.py index ec96f451..9bca1129 100644 --- a/feedparser/parsers/strict.py +++ b/feedparser/parsers/strict.py @@ -1,5 +1,5 @@ # The strict feed parser that interfaces with an XML parsing library -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/sanitizer.py b/feedparser/sanitizer.py index 7e4ce728..8052c5cf 100644 --- a/feedparser/sanitizer.py +++ b/feedparser/sanitizer.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/sgml.py b/feedparser/sgml.py index 7af2dbbd..7dc5bfdd 100644 --- a/feedparser/sgml.py +++ b/feedparser/sgml.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/urls.py b/feedparser/urls.py index 732e1c07..bc7cda56 100644 --- a/feedparser/urls.py +++ b/feedparser/urls.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/feedparser/util.py b/feedparser/util.py index b11aa711..d5af9e21 100644 --- a/feedparser/util.py +++ b/feedparser/util.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/setup.py b/setup.py index 288c33b2..e125641a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Kurt McKee +# Copyright 2010-2022 Kurt McKee # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # diff --git a/tests/wellformed/atom10/entry_content_and_summary.xml b/tests/wellformed/atom10/entry_content_and_summary.xml new file mode 100644 index 00000000..1c03d3bd --- /dev/null +++ b/tests/wellformed/atom10/entry_content_and_summary.xml @@ -0,0 +1,10 @@ + + + + Example Atom + Summary + +