Skip to content

Commit

Permalink
Update vendored feedparser to the develop branch as of 2024-06-26. #341
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Jun 26, 2024
1 parent 922be7f commit e79936c
Show file tree
Hide file tree
Showing 33 changed files with 2,962 additions and 2,383 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ Unreleased
* Prefer feed user title to feed title if available.
* Use feed title as artist, instead of author.

* Update vendored `feedparser`_ to the ``develop`` branch as of 2024-06-26.
Needed because upstream removed dependency on stdlib module ``cgi``
(removed in Python 3.13), but the `version 2.9 <Version 2.9_>`_
memory usage reduction was not released upstream yet.
(:issue:`341`)

.. _chenthur: https://github.com/chenthur
.. _feedparser: https://feedparser.readthedocs.io/en/latest/


Version 3.13
Expand Down
2 changes: 1 addition & 1 deletion src/reader/_parser/feedparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __call__(
# feedparser content sanitization and relative link resolution should be ON.
# https://github.com/lemon24/reader/issues/125
# https://github.com/lemon24/reader/issues/157
result = feedparser.parse( # type: ignore[attr-defined]
result = feedparser.parse(
resource,
resolve_relative_uris=True,
sanitize_html=True,
Expand Down
39 changes: 29 additions & 10 deletions src/reader/_vendor/feedparser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
"""
Vendored fork of feedparser:
https://github.com/lemon24/feedparser/tree/a29c54b7e83f7397c0c9f15c7ee73b537abac957
Vendored kurtmckee/feedparser:develop as of 2024-06-26:
https://github.com/kurtmckee/feedparser/tree/efcb89b51b6f7443ecea508a7a572e3f16e7cd4c
Includes pull requests:
Vendored because:
* memory usage reduction: https://github.com/kurtmckee/feedparser/pull/302
* latest release (6.0.11) does not include memory usage reduction PR
https://github.com/kurtmckee/feedparser/pull/302
Changes from the commit above:
* this comment
* api.py: fix "import feedparser" absolute imports
* api.py: fix "import feedparser" absolute import
TODO: Use feedparser once the pull requests are merged/released.
"""
# Copyright 2010-2021 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2010-2023 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
Expand Down Expand Up @@ -43,12 +44,18 @@

from .api import parse
from .datetimes import registerDateHandler
from .exceptions import *
from .exceptions import (
CharacterEncodingOverride,
CharacterEncodingUnknown,
FeedparserError,
NonXMLContentType,
UndeclaredNamespace,
)
from .util import FeedParserDict

__author__ = 'Kurt McKee <contactme@kurtmckee.org>'
__license__ = 'BSD 2-clause'
__version__ = '6.0.8'
__author__ = "Kurt McKee <contactme@kurtmckee.org>"
__license__ = "BSD 2-clause"
__version__ = "6.0.11"

# HTTP "User-Agent" header to send to servers when downloading feeds.
# If you are embedding feedparser in a larger application, you should
Expand All @@ -67,3 +74,15 @@
# If you want feedparser to use only a prefix of the feed to detect encodings
# (uses less memory), set this to 1.
OPTIMISTIC_ENCODING_DETECTION = 1


__all__ = (
"parse",
"registerDateHandler",
"FeedParserDict",
"FeedparserError",
"CharacterEncodingOverride",
"CharacterEncodingUnknown",
"NonXMLContentType",
"UndeclaredNamespace",
)
Loading

0 comments on commit e79936c

Please sign in to comment.