Skip to content

Commit 13c82b0

Browse files
committed
Removing 'charset' and 'errors' inputs from the Redis initialization arguments - deprecated 3 years ago.
1 parent 4e59d24 commit 13c82b0

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

docs/advanced_features.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,13 @@ run_in_thread.
384384
385385
A PubSub object adheres to the same encoding semantics as the client
386386
instance it was created from. Any channel or pattern that's unicode will
387-
be encoded using the charset specified on the client before being sent
387+
be encoded using the encoding specified on the client before being sent
388388
to Redis. If the client's decode_responses flag is set the False (the
389389
default), the 'channel', 'pattern' and 'data' values in message
390390
dictionaries will be byte strings (str on Python 2, bytes on Python 3).
391391
If the client's decode_responses is True, then the 'channel', 'pattern'
392392
and 'data' values will be automatically decoded to unicode strings using
393-
the client's charset.
393+
the client's encoding.
394394

395395
PubSub objects remember what channels and patterns they are subscribed
396396
to. In the event of a disconnection such as a network error or timeout,

redis/client.py

-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import re
33
import threading
44
import time
5-
import warnings
65
from itertools import chain
76
from typing import (
87
TYPE_CHECKING,
@@ -203,8 +202,6 @@ def __init__(
203202
unix_socket_path: Optional[str] = None,
204203
encoding: str = "utf-8",
205204
encoding_errors: str = "strict",
206-
charset: Optional[str] = None,
207-
errors: Optional[str] = None,
208205
decode_responses: bool = False,
209206
retry_on_timeout: bool = False,
210207
retry_on_error: Optional[List[Type[Exception]]] = None,
@@ -256,20 +253,6 @@ def __init__(
256253
else:
257254
self._event_dispatcher = event_dispatcher
258255
if not connection_pool:
259-
if charset is not None:
260-
warnings.warn(
261-
DeprecationWarning(
262-
'"charset" is deprecated. Use "encoding" instead'
263-
)
264-
)
265-
encoding = charset
266-
if errors is not None:
267-
warnings.warn(
268-
DeprecationWarning(
269-
'"errors" is deprecated. Use "encoding_errors" instead'
270-
)
271-
)
272-
encoding_errors = errors
273256
if not retry_on_error:
274257
retry_on_error = []
275258
if retry_on_timeout is True:

redis/cluster.py

-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def parse_cluster_myshardid(resp, **options):
142142
SLOT_ID = "slot-id"
143143

144144
REDIS_ALLOWED_KEYS = (
145-
"charset",
146145
"connection_class",
147146
"connection_pool",
148147
"connection_pool_class",
@@ -152,7 +151,6 @@ def parse_cluster_myshardid(resp, **options):
152151
"decode_responses",
153152
"encoding",
154153
"encoding_errors",
155-
"errors",
156154
"host",
157155
"lib_name",
158156
"lib_version",

0 commit comments

Comments
 (0)