(self, message)
| 202 | raise NotImplementedError('Method must be implemented by subclass') |
| 203 | |
| 204 | def _string_to_bytes(self, message): |
| 205 | # If a message is not 7bit clean, we refuse to handle it since it |
| 206 | # likely came from reading invalid messages in text mode, and that way |
| 207 | # lies mojibake. |
| 208 | try: |
| 209 | return message.encode('ascii') |
| 210 | except UnicodeError: |
| 211 | raise ValueError("String input must be ASCII-only; " |
| 212 | "use bytes or a Message instead") |
| 213 | |
| 214 | # Whether each message must end in a newline |
| 215 | _append_newline = False |
no test coverage detected