Internal: get a response from the server. Raise various errors if the response indicates an error. Returns a unicode string.
(self)
| 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. |
no test coverage detected