Skip to content

Removing 'charset' and 'errors' inputs from the Redis initialization arguments - deprecated 3 years ago. #3608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/advanced_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,13 @@ run_in_thread.

A PubSub object adheres to the same encoding semantics as the client
instance it was created from. Any channel or pattern that's unicode will
be encoded using the charset specified on the client before being sent
be encoded using the encoding specified on the client before being sent
to Redis. If the client's decode_responses flag is set the False (the
default), the 'channel', 'pattern' and 'data' values in message
dictionaries will be byte strings (str on Python 2, bytes on Python 3).
If the client's decode_responses is True, then the 'channel', 'pattern'
and 'data' values will be automatically decoded to unicode strings using
the client's charset.
the client's encoding.

PubSub objects remember what channels and patterns they are subscribed
to. In the event of a disconnection such as a network error or timeout,
Expand Down
17 changes: 0 additions & 17 deletions redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
import threading
import time
import warnings
from itertools import chain
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -203,8 +202,6 @@ def __init__(
unix_socket_path: Optional[str] = None,
encoding: str = "utf-8",
encoding_errors: str = "strict",
charset: Optional[str] = None,
errors: Optional[str] = None,
decode_responses: bool = False,
retry_on_timeout: bool = False,
retry_on_error: Optional[List[Type[Exception]]] = None,
Expand Down Expand Up @@ -256,20 +253,6 @@ def __init__(
else:
self._event_dispatcher = event_dispatcher
if not connection_pool:
if charset is not None:
warnings.warn(
DeprecationWarning(
'"charset" is deprecated. Use "encoding" instead'
)
)
encoding = charset
if errors is not None:
warnings.warn(
DeprecationWarning(
'"errors" is deprecated. Use "encoding_errors" instead'
)
)
encoding_errors = errors
if not retry_on_error:
retry_on_error = []
if retry_on_timeout is True:
Expand Down
2 changes: 0 additions & 2 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def parse_cluster_myshardid(resp, **options):
SLOT_ID = "slot-id"

REDIS_ALLOWED_KEYS = (
"charset",
"connection_class",
"connection_pool",
"connection_pool_class",
Expand All @@ -152,7 +151,6 @@ def parse_cluster_myshardid(resp, **options):
"decode_responses",
"encoding",
"encoding_errors",
"errors",
"host",
"lib_name",
"lib_version",
Expand Down
Loading