Skip to content

Remove deprecated nntplib method #83547

Closed

Description

@corona10
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']

    Activity

    1. corona10 commented on Jan 17, 2020

      @corona10
      MemberAuthor

      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

    2. self-assigned this
      on Jan 17, 2020
    3. self-assigned this
      on Jan 17, 2020
    4. vstinner commented on Jan 17, 2020

      @vstinner
      Member

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

    5. corona10 commented on Jan 17, 2020

      @corona10
      MemberAuthor

      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?
    6. vstinner commented on Jan 17, 2020

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

    7. corona10 commented on Jan 17, 2020

      @corona10
      MemberAuthor

      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)')])
    8. vstinner commented on Jan 17, 2020

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

    9. berkerpeksag commented on Jan 22, 2020

      @berkerpeksag
      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

    10. berkerpeksag commented on Jan 22, 2020

      @berkerpeksag
      Member

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

    11. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jan 22, 2020
    12. added
      type-featureA feature request or enhancement
      stdlibStandard Library Python modules in the Lib/ directory
      on Jan 22, 2020
    13. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions