MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _getresp

Method _getresp

tools/python-3.11.9-amd64/Lib/nntplib.py:477–491  ·  view source on GitHub ↗

Internal: get a response from the server. Raise various errors if the response indicates an error. Returns a unicode string.

(self)

Source from the content-addressed store, hash-verified

475 return line
476
477 def _getresp(self):
478 """Internal: get a response from the server.
479 Raise various errors if the response indicates an error.
480 Returns a unicode string."""
481 resp = self._getline()
482 if self.debugging: print('*resp*', repr(resp))
483 resp = resp.decode(self.encoding, self.errors)
484 c = resp[:1]
485 if c == '4':
486 raise NNTPTemporaryError(resp)
487 if c == '5':
488 raise NNTPPermanentError(resp)
489 if c not in '123':
490 raise NNTPProtocolError(resp)
491 return resp
492
493 def _getlongresp(self, file=None):
494 """Internal: get a response plus following text from the server.

Callers 4

_base_initMethod · 0.95
_getlongrespMethod · 0.95
_shortcmdMethod · 0.95
_postMethod · 0.95

Calls 6

_getlineMethod · 0.95
NNTPTemporaryErrorClass · 0.85
NNTPPermanentErrorClass · 0.85
NNTPProtocolErrorClass · 0.85
printFunction · 0.50
decodeMethod · 0.45

Tested by

no test coverage detected