Skip to content
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

Closed
corona10 opened this issue Jan 17, 2020 · 8 comments
Closed

Remove deprecated nntplib method #83547

corona10 opened this issue Jan 17, 2020 · 8 comments
Assignees
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@corona10
Copy link
Member

BPO 39366
Nosy @vstinner, @berkerpeksag, @corona10
PRs
  • bpo-39366: Remove xpath() and xgtitle() methods of NNTP. #18035
  • 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:

    assignee = 'https://github.com/corona10'
    closed_at = <Date 2020-01-22.22:01:26.254>
    created_at = <Date 2020-01-17.09:11:15.286>
    labels = ['type-feature', 'library', '3.9']
    title = 'Remove deprecated nntplib method'
    updated_at = <Date 2020-01-22.22:01:26.251>
    user = 'https://github.com/corona10'

    bugs.python.org fields:

    activity = <Date 2020-01-22.22:01:26.251>
    actor = 'berker.peksag'
    assignee = 'corona10'
    closed = True
    closed_date = <Date 2020-01-22.22:01:26.254>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2020-01-17.09:11:15.286>
    creator = 'corona10'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39366
    keywords = ['patch']
    message_count = 8.0
    messages = ['360163', '360169', '360188', '360190', '360192', '360197', '360512', '360514']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'berker.peksag', 'corona10']
    pr_nums = ['18035']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue39366'
    versions = ['Python 3.9']

    @corona10
    Copy link
    Member Author

    Remove deprecated methods since Python 3.3.
    Moreover nntplib.NNTP.xgtitle has not been exposed through docs.python.org
    https://docs.python.org/3/library/nntplib.html

    @corona10 corona10 added the 3.9 only security fixes label Jan 17, 2020
    @corona10 corona10 self-assigned this Jan 17, 2020
    @corona10 corona10 added the 3.9 only security fixes label Jan 17, 2020
    @corona10 corona10 self-assigned this Jan 17, 2020
    @vstinner
    Copy link
    Member

    I'm not used to the NNTP protocol. Does the news.gmane.io support these 2 extensions?

    @corona10
    Copy link
    Member Author

    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?

    @vstinner
    Copy link
    Member

    >>> 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?

    @corona10
    Copy link
    Member Author

    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)')])

    @vstinner
    Copy link
    Member

    >>> 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.

    @berkerpeksag
    Copy link
    Member

    New changeset 1f0f102 by Berker Peksag (Dong-hee Na) in branch 'master':
    bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035)
    1f0f102

    @berkerpeksag
    Copy link
    Member

    Thanks for the PR! I'm glad these previously deprecated functions are now gone.

    @berkerpeksag berkerpeksag added the stdlib Python modules in the Lib dir label Jan 22, 2020
    @berkerpeksag berkerpeksag added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Jan 22, 2020
    @berkerpeksag berkerpeksag added the type-feature A feature request or enhancement label Jan 22, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants