Skip to content

Conversation

bobwhitelock
Copy link

@bobwhitelock bobwhitelock commented Jul 2, 2025

In 02b79cd7#diff-5b5ad4c6a0c0168d28c2bf52c57980ca5883e83bbb44de82db6c9715307a49bcR26-R31, custom HTTP client code was dropped along with various parameters for customizing requests made by feedparser. However there are still various references to these parameters in the docs; this commit drops references to anything no longer supported and makes some minimal updates to reference what you should now do instead.

I haven't read all the docs so can't promise this is an exhaustive update to everything that's no longer applicable following this commit - I just searched for each of the no longer available parameters, and updated the docs in these places.

One place that also looks like it should be updated is https://github.com/kurtmckee/feedparser/blob/main/docs/http-etag.rst - since you can no longer pass either etag or modified to parse - but I'm not sure what the new approach to handling these should be.

authentication yourself and then parse the retrieved feed.


Downloading a feed protected by basic authentication (the easy way)
Copy link
Author

@bobwhitelock bobwhitelock Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic auth still seems to work fine, as requests supports these type of URLs - for anything else it seems like you need to handle authentication yourself

type of handler you'll need to construct. The realm name is given as
realm="foo" -- so foo would be your first argument to auth.add_password. Other
information in the www-authenticate header is probably safe to ignore; the
:file:`urllib2` module will handle it for you.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this part of the sentence makes sense since urllib2 isn't being used

:abbr:`URL (Uniform Resource Locator)`.


Customizing the User-Agent
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting feedparser.USER_AGENT should still work, so have left that section, but the agent parameter is no longer present

In
kurtmckee@02b79cd7#diff-5b5ad4c6a0c0168d28c2bf52c57980ca5883e83bbb44de82db6c9715307a49bcR26-R31,
custom HTTP client code was dropped along with various parameters for
customizing requests made by `feedparser`. However there are still
various references to these parameters in the docs; this commit drops
references to anything no longer supported and makes some minimal
updates to reference what you should now do instead.
@bobwhitelock bobwhitelock force-pushed the update-docs-for-dropped-http-client-code branch from 7afbaa9 to debeaa5 Compare July 2, 2025 22:13
>>> import feedparser
>>> d = feedparser.parse('http://test:basic@feedparser.org/docs/examples/basic_auth.xml')
>>> d = feedparser.parse('http://test:basic@$READTHEDOCS_CANONICAL_URL/examples/basic_auth.xml')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous URL was no longer available, so the example didn't work

I believe this should get expanded to https://feedparser.readthedocs.io/en/latest/examples/basic_auth.xml instead, which should work - though this feed doesn't actually seem to be protected by basic auth (and same for https://feedparser.readthedocs.io/en/latest/examples/digest_auth.xml), but I checked this works with a different URL that does have basic auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant