From 71cd7855d4a0f0d350ba4f06554fd25aad1887ba Mon Sep 17 00:00:00 2001 From: yusuke-enomoto Date: Thu, 24 Mar 2016 17:26:23 +0900 Subject: [PATCH 1/4] no independent description and content (Rebase patch on 6.0.2) --- feedparser/mixin.py | 1 + feedparser/namespaces/_base.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/feedparser/mixin.py b/feedparser/mixin.py index f305015b9..f2c998af5 100644 --- a/feedparser/mixin.py +++ b/feedparser/mixin.py @@ -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 61446ffe9..39d29373f 100644 --- a/feedparser/namespaces/_base.py +++ b/feedparser/namespaces/_base.py @@ -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 From 6e35ff74d2d18eaf622df495f051d7e62db66b3b Mon Sep 17 00:00:00 2001 From: cristoper <331548+cristoper@users.noreply.github.com> Date: Wed, 12 Apr 2017 00:44:12 -0600 Subject: [PATCH 2/4] Test case for issue 59 If follows , it should not be overwritten. (This is apparently a regression introduced way back in b06df763a0465ffd9acf7b) --- tests/wellformed/atom10/entry_content_and_summary.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/wellformed/atom10/entry_content_and_summary.xml 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 000000000..1c03d3bd4 --- /dev/null +++ b/tests/wellformed/atom10/entry_content_and_summary.xml @@ -0,0 +1,10 @@ + + + + Example Atom + Summary + + From 17843c7e8877a791baf74536be827a378ffcf1db Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sat, 21 May 2022 08:49:06 -0500 Subject: [PATCH 3/4] Bump project metadata --- NEWS | 3 +++ feedparser/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1339cf07f..2b39e7e2e 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/feedparser/__init__.py b/feedparser/__init__.py index 2e73bfa79..2bcdd8441 100644 --- a/feedparser/__init__.py +++ b/feedparser/__init__.py @@ -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 From b7cffc989be435cd10720bf3ccf003a797d4af27 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sat, 21 May 2022 08:51:45 -0500 Subject: [PATCH 4/4] Bump copyrights --- LICENSE | 4 ++-- README.rst | 2 +- docs/conf.py | 2 +- docs/license.rst | 2 +- dodo.py | 2 +- feedparser/__init__.py | 2 +- feedparser/api.py | 2 +- feedparser/datetimes/__init__.py | 2 +- feedparser/datetimes/asctime.py | 2 +- feedparser/datetimes/greek.py | 2 +- feedparser/datetimes/hungarian.py | 2 +- feedparser/datetimes/iso8601.py | 2 +- feedparser/datetimes/korean.py | 2 +- feedparser/datetimes/perforce.py | 2 +- feedparser/datetimes/rfc822.py | 2 +- feedparser/datetimes/w3dtf.py | 2 +- feedparser/encodings.py | 2 +- feedparser/exceptions.py | 2 +- feedparser/html.py | 2 +- feedparser/http.py | 2 +- feedparser/mixin.py | 2 +- feedparser/namespaces/_base.py | 2 +- feedparser/namespaces/admin.py | 2 +- feedparser/namespaces/cc.py | 2 +- feedparser/namespaces/dc.py | 2 +- feedparser/namespaces/georss.py | 2 +- feedparser/namespaces/itunes.py | 2 +- feedparser/namespaces/mediarss.py | 2 +- feedparser/namespaces/psc.py | 2 +- feedparser/parsers/loose.py | 2 +- feedparser/parsers/strict.py | 2 +- feedparser/sanitizer.py | 2 +- feedparser/sgml.py | 2 +- feedparser/urls.py | 2 +- feedparser/util.py | 2 +- setup.py | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/LICENSE b/LICENSE index f1bc4b55b..70b8167f3 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/README.rst b/README.rst index 9406aeaf3..8b64e625c 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 4bd1ba379..92efb4525 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 1f8c789d7..46943f0f1 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 59870cf8f..22da22c3e 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 2bcdd8441..1e8877c08 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. # diff --git a/feedparser/api.py b/feedparser/api.py index 837cde153..aed3f4792 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 f33bb6c7c..21487a0f5 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 8e6517764..c4b162497 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 63329235f..7f433fed8 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 df18fe13d..691a6ebc2 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 2fe470911..b7463a52a 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 6af7a0305..788d46668 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 1a8aff105..d52a838b3 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 ceb409673..871e18fdd 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 28577b595..6fb2c5459 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 6260f29f5..f939f468b 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 b1f5c60a7..3a022811e 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 9728fb0c8..3ffa9b888 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 92f694552..9d441038d 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 b5407acdb..745423694 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. # diff --git a/feedparser/namespaces/_base.py b/feedparser/namespaces/_base.py index f73437d4e..6478a76c8 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. # diff --git a/feedparser/namespaces/admin.py b/feedparser/namespaces/admin.py index 39d986eba..742183483 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 53eccf72e..6735c5fe8 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 2c8277478..a89221d2d 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 62605f01a..786a926fb 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 cbf30af43..a50a0ea89 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 e2ad2caea..2298ad2f7 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 97af33460..a440bd683 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 620aeb578..d6c97e106 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 ec96f451c..9bca11292 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 7e4ce7289..8052c5cfd 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 7af2dbbd5..7dc5bfdd1 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 732e1c072..bc7cda56e 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 b11aa7119..d5af9e218 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 288c33b29..e125641aa 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. #