{
    "mode": "pydoc",
    "parameter": "nntplib",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/nntplib/json",
    "generated": "2026-06-02T15:07:22Z",
    "sections": {
        "NAME": {
            "content": "nntplib\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/nntplib.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "An NNTP client class based on:\n- RFC 977: Network News Transfer Protocol\n- RFC 2980: Common NNTP Extensions\n- RFC 3977: Network News Transfer Protocol (version 2)\n\nExample:\n\n>>> from nntplib import NNTP\n>>> s = NNTP('news')\n>>> resp, count, first, last, name = s.group('comp.lang.python')\n>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)\nGroup comp.lang.python has 51 articles, range 5770 to 5821\n>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))\n>>> resp = s.quit()\n>>>\n\nHere 'resp' is the server response line.\nError responses are turned into exceptions.\n\nTo post an article from a file:\n>>> f = open(filename, 'rb') # file containing article, including header\n>>> resp = s.post(f)\n>>>\n\nFor descriptions of all methods, read the comments in the code below.\nNote that all arguments and return values representing article numbers\nare strings, not numbers, since they are rarely used for calculations.\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.Exception(builtins.BaseException)\nNNTPError\nNNTPDataError\nNNTPPermanentError\nNNTPProtocolError\nNNTPReplyError\nNNTPTemporaryError\nbuiltins.object\nNNTP\nNNTPSSL\n",
            "subsections": [
                {
                    "name": "class NNTP",
                    "content": "|  NNTP(host, port=119, user=None, password=None, readermode=None, usenetrc=False, timeout=<object object at 0x7fd8747f4a50>)\n|\n|  # The classes themselves\n|\n|  Methods defined here:\n|\n|  enter(self)\n|\n|  exit(self, *args)\n|\n|  init(self, host, port=119, user=None, password=None, readermode=None, usenetrc=False, timeout=<object object at 0x7fd8747f4a50>)\n|      Initialize an instance.  Arguments:\n|      - host: hostname to connect to\n|      - port: port to connect to (default the standard NNTP port)\n|      - user: username to authenticate with\n|      - password: password to use with username\n|      - readermode: if true, send 'mode reader' command after\n|                    connecting.\n|      - usenetrc: allow loading username and password from ~/.netrc file\n|                  if not specified explicitly\n|      - timeout: timeout (in seconds) used for socket connections\n|\n|      readermode is sometimes necessary if you are connecting to an\n|      NNTP server on the local machine and intend to call\n|      reader-specific commands, such as `group'.  If you get\n|      unexpected NNTPPermanentErrors, you might need to set\n|      readermode.\n|\n|  article(self, messagespec=None, *, file=None)\n|      Process an ARTICLE command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the article in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of article lines)\n|\n|  body(self, messagespec=None, *, file=None)\n|      Process a BODY command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the body in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of body lines)\n|\n|  capabilities(self)\n|      Process a CAPABILITIES command.  Not supported by all servers.\n|      Return:\n|      - resp: server response if successful\n|      - caps: a dictionary mapping capability names to lists of tokens\n|      (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })\n|\n|  date(self)\n|      Process the DATE command.\n|      Returns:\n|      - resp: server response if successful\n|      - date: datetime object\n|\n|  debug = setdebuglevel(self, level)\n|\n|  description(self, group)\n|      Get a description for a single group.  If more than one\n|      group matches ('group' is a pattern), return the first.  If no\n|      group matches, return an empty string.\n|\n|      This elides the response code from the server, since it can\n|      only be '215' or '285' (for xgtitle) anyway.  If the response\n|      code is needed, use the 'descriptions' method.\n|\n|      NOTE: This neither checks for a wildcard in 'group' nor does\n|      it check whether the group actually exists.\n|\n|  descriptions(self, grouppattern)\n|      Get descriptions for a range of groups.\n|\n|  getcapabilities(self)\n|      Get the server capabilities, as read by init().\n|      If the CAPABILITIES command is not supported, an empty dict is\n|      returned.\n|\n|  getwelcome(self)\n|      Get the welcome message from the server\n|      (this is read and squirreled away by init()).\n|      If the response code is 200, posting is allowed;\n|      if it 201, posting is not allowed.\n|\n|  group(self, name)\n|      Process a GROUP command.  Argument:\n|      - group: the group name\n|      Returns:\n|      - resp: server response if successful\n|      - count: number of articles\n|      - first: first article number\n|      - last: last article number\n|      - name: the group name\n|\n|  head(self, messagespec=None, *, file=None)\n|      Process a HEAD command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the headers in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of header lines)\n|\n|  help(self, *, file=None)\n|      Process a HELP command. Argument:\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of strings returned by the server in response to the\n|              HELP command\n|\n|  ihave(self, messageid, data)\n|      Process an IHAVE command.  Arguments:\n|      - messageid: message-id of the article\n|      - data: file containing the article\n|      Returns:\n|      - resp: server response if successful\n|      Note that if the server refuses the article an exception is raised.\n|\n|  last(self)\n|      Process a LAST command.  No arguments.  Return as for STAT.\n|\n|  list(self, grouppattern=None, *, file=None)\n|      Process a LIST or LIST ACTIVE command. Arguments:\n|      - grouppattern: a pattern indicating which groups to query\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of (group, last, first, flag) (strings)\n|\n|  login(self, user=None, password=None, usenetrc=True)\n|\n|  newgroups(self, date, *, file=None)\n|      Process a NEWGROUPS command.  Arguments:\n|      - date: a date or datetime object\n|      Return:\n|      - resp: server response if successful\n|      - list: list of newsgroup names\n|\n|  newnews(self, group, date, *, file=None)\n|      Process a NEWNEWS command.  Arguments:\n|      - group: group name or '*'\n|      - date: a date or datetime object\n|      Return:\n|      - resp: server response if successful\n|      - list: list of message ids\n|\n|  next(self)\n|      Process a NEXT command.  No arguments.  Return as for STAT.\n|\n|  over(self, messagespec, *, file=None)\n|      Process an OVER command.  If the command isn't supported, fall\n|      back to XOVER. Arguments:\n|      - messagespec:\n|          - either a message id, indicating the article to fetch\n|            information about\n|          - or a (start, end) tuple, indicating a range of article numbers;\n|            if end is None, information up to the newest message will be\n|            retrieved\n|          - or None, indicating the current article number must be used\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of dicts containing the response fields\n|\n|      NOTE: the \"message id\" form isn't supported by XOVER\n|\n|  post(self, data)\n|      Process a POST command.  Arguments:\n|      - data: bytes object, iterable or file containing the article\n|      Returns:\n|      - resp: server response if successful\n|\n|  quit(self)\n|      Process a QUIT command and close the socket.  Returns:\n|      - resp: server response if successful\n|\n|  setdebuglevel(self, level)\n|      Set the debugging level.  Argument 'level' means:\n|      0: no debugging output (default)\n|      1: print commands and responses but not body text etc.\n|      2: also print raw lines read and sent before stripping CR/LF\n|\n|  slave(self)\n|      Process a SLAVE command.  Returns:\n|      - resp: server response if successful\n|\n|  starttls(self, context=None)\n|      Process a STARTTLS command. Arguments:\n|      - context: SSL context to use for the encrypted connection\n|\n|  stat(self, messagespec=None)\n|      Process a STAT command.  Argument:\n|      - messagespec: article number or message id (if not specified,\n|        the current article is selected)\n|      Returns:\n|      - resp: server response if successful\n|      - artnum: the article number\n|      - messageid: the message id\n|\n|  xhdr(self, hdr, str, *, file=None)\n|      Process an XHDR command (optional server extension).  Arguments:\n|      - hdr: the header type (e.g. 'subject')\n|      - str: an article nr, a message id, or a range nr1-nr2\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of (nr, value) strings\n|\n|  xover(self, start, end, *, file=None)\n|      Process an XOVER command (optional server extension) Arguments:\n|      - start: start of range\n|      - end: end of range\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of dicts containing the response fields\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  encoding = 'utf-8'\n|\n|  errors = 'surrogateescape'\n"
                },
                {
                    "name": "class NNTPDataError",
                    "content": "|  NNTPDataError(*args)\n|\n|  Error in response data\n|\n|  Method resolution order:\n|      NNTPDataError\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods inherited from NNTPError:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTPError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTPError",
                    "content": "|  NNTPError(*args)\n|\n|  Base class for all nntplib exceptions\n|\n|  Method resolution order:\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTPPermanentError",
                    "content": "|  NNTPPermanentError(*args)\n|\n|  5xx errors\n|\n|  Method resolution order:\n|      NNTPPermanentError\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods inherited from NNTPError:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTPError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTPProtocolError",
                    "content": "|  NNTPProtocolError(*args)\n|\n|  Response does not begin with [1-5]\n|\n|  Method resolution order:\n|      NNTPProtocolError\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods inherited from NNTPError:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTPError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTPReplyError",
                    "content": "|  NNTPReplyError(*args)\n|\n|  Unexpected [123]xx reply\n|\n|  Method resolution order:\n|      NNTPReplyError\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods inherited from NNTPError:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTPError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTPTemporaryError",
                    "content": "|  NNTPTemporaryError(*args)\n|\n|  4xx errors\n|\n|  Method resolution order:\n|      NNTPTemporaryError\n|      NNTPError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods inherited from NNTPError:\n|\n|  init(self, *args)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTPError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class NNTP_SSL",
                    "content": "|  NNTPSSL(host, port=563, user=None, password=None, sslcontext=None, readermode=None, usenetrc=False, timeout=<object object at 0x7fd8747f4a50>)\n|\n|  Method resolution order:\n|      NNTPSSL\n|      NNTP\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, host, port=563, user=None, password=None, sslcontext=None, readermode=None, usenetrc=False, timeout=<object object at 0x7fd8747f4a50>)\n|      This works identically to NNTP.init, except for the change\n|      in default port and the `sslcontext` argument for SSL connections.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from NNTP:\n|\n|  enter(self)\n|\n|  exit(self, *args)\n|\n|  article(self, messagespec=None, *, file=None)\n|      Process an ARTICLE command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the article in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of article lines)\n|\n|  body(self, messagespec=None, *, file=None)\n|      Process a BODY command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the body in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of body lines)\n|\n|  capabilities(self)\n|      Process a CAPABILITIES command.  Not supported by all servers.\n|      Return:\n|      - resp: server response if successful\n|      - caps: a dictionary mapping capability names to lists of tokens\n|      (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })\n|\n|  date(self)\n|      Process the DATE command.\n|      Returns:\n|      - resp: server response if successful\n|      - date: datetime object\n|\n|  debug = setdebuglevel(self, level)\n|\n|  description(self, group)\n|      Get a description for a single group.  If more than one\n|      group matches ('group' is a pattern), return the first.  If no\n|      group matches, return an empty string.\n|\n|      This elides the response code from the server, since it can\n|      only be '215' or '285' (for xgtitle) anyway.  If the response\n|      code is needed, use the 'descriptions' method.\n|\n|      NOTE: This neither checks for a wildcard in 'group' nor does\n|      it check whether the group actually exists.\n|\n|  descriptions(self, grouppattern)\n|      Get descriptions for a range of groups.\n|\n|  getcapabilities(self)\n|      Get the server capabilities, as read by init().\n|      If the CAPABILITIES command is not supported, an empty dict is\n|      returned.\n|\n|  getwelcome(self)\n|      Get the welcome message from the server\n|      (this is read and squirreled away by init()).\n|      If the response code is 200, posting is allowed;\n|      if it 201, posting is not allowed.\n|\n|  group(self, name)\n|      Process a GROUP command.  Argument:\n|      - group: the group name\n|      Returns:\n|      - resp: server response if successful\n|      - count: number of articles\n|      - first: first article number\n|      - last: last article number\n|      - name: the group name\n|\n|  head(self, messagespec=None, *, file=None)\n|      Process a HEAD command.  Argument:\n|      - messagespec: article number or message id\n|      - file: filename string or file object to store the headers in\n|      Returns:\n|      - resp: server response if successful\n|      - ArticleInfo: (article number, message id, list of header lines)\n|\n|  help(self, *, file=None)\n|      Process a HELP command. Argument:\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of strings returned by the server in response to the\n|              HELP command\n|\n|  ihave(self, messageid, data)\n|      Process an IHAVE command.  Arguments:\n|      - messageid: message-id of the article\n|      - data: file containing the article\n|      Returns:\n|      - resp: server response if successful\n|      Note that if the server refuses the article an exception is raised.\n|\n|  last(self)\n|      Process a LAST command.  No arguments.  Return as for STAT.\n|\n|  list(self, grouppattern=None, *, file=None)\n|      Process a LIST or LIST ACTIVE command. Arguments:\n|      - grouppattern: a pattern indicating which groups to query\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of (group, last, first, flag) (strings)\n|\n|  login(self, user=None, password=None, usenetrc=True)\n|\n|  newgroups(self, date, *, file=None)\n|      Process a NEWGROUPS command.  Arguments:\n|      - date: a date or datetime object\n|      Return:\n|      - resp: server response if successful\n|      - list: list of newsgroup names\n|\n|  newnews(self, group, date, *, file=None)\n|      Process a NEWNEWS command.  Arguments:\n|      - group: group name or '*'\n|      - date: a date or datetime object\n|      Return:\n|      - resp: server response if successful\n|      - list: list of message ids\n|\n|  next(self)\n|      Process a NEXT command.  No arguments.  Return as for STAT.\n|\n|  over(self, messagespec, *, file=None)\n|      Process an OVER command.  If the command isn't supported, fall\n|      back to XOVER. Arguments:\n|      - messagespec:\n|          - either a message id, indicating the article to fetch\n|            information about\n|          - or a (start, end) tuple, indicating a range of article numbers;\n|            if end is None, information up to the newest message will be\n|            retrieved\n|          - or None, indicating the current article number must be used\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of dicts containing the response fields\n|\n|      NOTE: the \"message id\" form isn't supported by XOVER\n|\n|  post(self, data)\n|      Process a POST command.  Arguments:\n|      - data: bytes object, iterable or file containing the article\n|      Returns:\n|      - resp: server response if successful\n|\n|  quit(self)\n|      Process a QUIT command and close the socket.  Returns:\n|      - resp: server response if successful\n|\n|  setdebuglevel(self, level)\n|      Set the debugging level.  Argument 'level' means:\n|      0: no debugging output (default)\n|      1: print commands and responses but not body text etc.\n|      2: also print raw lines read and sent before stripping CR/LF\n|\n|  slave(self)\n|      Process a SLAVE command.  Returns:\n|      - resp: server response if successful\n|\n|  starttls(self, context=None)\n|      Process a STARTTLS command. Arguments:\n|      - context: SSL context to use for the encrypted connection\n|\n|  stat(self, messagespec=None)\n|      Process a STAT command.  Argument:\n|      - messagespec: article number or message id (if not specified,\n|        the current article is selected)\n|      Returns:\n|      - resp: server response if successful\n|      - artnum: the article number\n|      - messageid: the message id\n|\n|  xhdr(self, hdr, str, *, file=None)\n|      Process an XHDR command (optional server extension).  Arguments:\n|      - hdr: the header type (e.g. 'subject')\n|      - str: an article nr, a message id, or a range nr1-nr2\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of (nr, value) strings\n|\n|  xover(self, start, end, *, file=None)\n|      Process an XOVER command (optional server extension) Arguments:\n|      - start: start of range\n|      - end: end of range\n|      - file: Filename string or file object to store the result in\n|      Returns:\n|      - resp: server response if successful\n|      - list: list of dicts containing the response fields\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from NNTP:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from NNTP:\n|\n|  encoding = 'utf-8'\n|\n|  errors = 'surrogateescape'\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "decode_header",
                    "content": "Takes a unicode string representing a munged header value\nand decodes it as a (possibly non-ASCII) readable value.\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['NNTP', 'NNTPError', 'NNTPReplyError', 'NNTPTemporaryError'...\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/nntplib.py\n\n",
            "subsections": []
        }
    },
    "summary": "nntplib",
    "flags": [],
    "examples": [],
    "see_also": []
}