-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Remove deprecated nntplib method #83547
Comments
Remove deprecated methods since Python 3.3. |
I'm not used to the NNTP protocol. Does the news.gmane.io support these 2 extensions? |
Looks like xgtitle is supported but xpath is not. >>> a.xgtitle('gmane.comp.python.committers')
('282 Descriptions in form "group description"', [('gmane.comp.python.committers', 'CPython Committers (non-public) (Moderated)')])
>>> a.xpath(message_id)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/nntplib.py", line 865, in xpath
resp = self._shortcmd('XPATH {0}'.format(id))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/nntplib.py", line 513, in _shortcmd
return self._getresp()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/nntplib.py", line 458, in _getresp
raise NNTPPermanentError(resp)
nntplib.NNTPPermanentError: 500 What? |
>>> a.xgtitle('gmane.comp.python.committers')
('282 Descriptions in form "group description"', [('gmane.comp.python.committers', 'CPython Committers (non-public) (Moderated)')]) Does https://docs.python.org/dev/library/nntplib.html#nntplib.NNTP.description give the same result? |
Not exactly same but descriptions give a similar result. >>> import nntplib
>>> a = nntplib.NNTP('news.gmane.io')
>>> a.description('gmane.comp.python.committers')
'CPython Committers (non-public) (Moderated)'
>>> a.descriptions('gmane.comp.python.committers')
('215 Newsgroup descriptions in form "group description"', {'gmane.comp.python.committers': 'CPython Committers (non-public) (Moderated)'})
>>> a.xgtitle('gmane.comp.python.committers')
<stdin>:1: DeprecationWarning: The XGTITLE extension is not actively used, use descriptions() instead
('282 Descriptions in form "group description"', [('gmane.comp.python.committers', 'CPython Committers (non-public) (Moderated)')]) |
>>> a.description('gmane.comp.python.committers')
'CPython Committers (non-public) (Moderated)'
>>> a.descriptions('gmane.comp.python.committers')
('215 Newsgroup descriptions in form "group description"', {'gmane.comp.python.committers': 'CPython Committers (non-public) (Moderated)'}) Well, both results contain the same important string: 'CPython Committers (non-public) (Moderated)'. So I think that it's ok to drop xgtitle() as well. |
Thanks for the PR! I'm glad these previously deprecated functions are now gone. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: