Return an encoder based on encoding settings
(self)
| 1613 | return connection |
| 1614 | |
| 1615 | def get_encoder(self): |
| 1616 | """Return an encoder based on encoding settings""" |
| 1617 | kwargs = self.connection_kwargs |
| 1618 | return self.encoder_class( |
| 1619 | encoding=kwargs.get("encoding", "utf-8"), |
| 1620 | encoding_errors=kwargs.get("encoding_errors", "strict"), |
| 1621 | decode_responses=kwargs.get("decode_responses", False), |
| 1622 | ) |
| 1623 | |
| 1624 | def make_connection(self): |
| 1625 | """Create a new connection. Can be overridden by child classes.""" |