-
-
Notifications
You must be signed in to change notification settings - Fork 352
Update docs for dropped HTTP client code #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update docs for dropped HTTP client code #520
Conversation
authentication yourself and then parse the retrieved feed. | ||
|
||
|
||
Downloading a feed protected by basic authentication (the easy way) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
7afbaa9
to
debeaa5
Compare
>>> 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') |
There was a problem hiding this comment.
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
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
ormodified
toparse
- but I'm not sure what the new approach to handling these should be.