(self)
| 209 | # Internal: return one line from the server, stripping CRLF. |
| 210 | # Raise EOFError if the connection is closed |
| 211 | def getline(self): |
| 212 | line = self.file.readline(self.maxline + 1) |
| 213 | if len(line) > self.maxline: |
| 214 | raise Error("got more than %d bytes" % self.maxline) |
| 215 | if self.debugging > 1: |
| 216 | print('*get*', self.sanitize(line)) |
| 217 | if not line: |
| 218 | raise EOFError |
| 219 | if line[-2:] == CRLF: |
| 220 | line = line[:-2] |
| 221 | elif line[-1:] in CRLF: |
| 222 | line = line[:-1] |
| 223 | return line |
| 224 | |
| 225 | # Internal: get a response from the server, which may possibly |
| 226 | # consist of multiple lines. Return a single string with no |
no test coverage detected