You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ssl.SSLContext() without protocol argument is deprecated. #260
I can confirm @robmcd issue. 2.1.5 as well and console is flooded, the inability to even disable this with PYTHONWARNINGS makes the experience suboptimal for python > 3.9
I confirm I have this happening on redshift-connector 2.1.8.
Every run throws throws the following warning:
/Users/Shared/web/data-analytics/dbt-env/lib/python3.11/site-packages/redshift_connector/core.py:663: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated.
/Users/Shared/web/data-analytics/dbt-env/lib/python3.11/site-packages/redshift_connector/core.py:663: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
This leads to thousands of lines in the console that is not helpful and detracts from being able to see the information that's important.
I'm also experiencing this on redshift-connector 2.1.8.
During every run it gives me these errors multiple times
/Users/Shared/web/data-analytics/dbt-env/lib/python3.11/site-packages/redshift_connector/core.py:663: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated.
/Users/Shared/web/data-analytics/dbt-env/lib/python3.11/site-packages/redshift_connector/core.py:663: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated.
This has been going on for ages and is been ignored by the team. To avoid this issue, you can copy the script below and save it as suppress-deprecation-warnings.sh. Execute it and it will copy a file sitecustomize.py in site-packages directory and it sets a filter to suppress the messages. Using PYTHONWARNINGS does not work otherwise.
#!/bin/bash# This script will set a sitecustomize.py in site-packages in order to suppress the warnings# emitted by redshift-connector which is polluting the console## suppress-deprecation-warnings.sh# Usage: ./suppress-deprecation-warnings.sh [venv_path]# If no path provided, uses currently activated virtual environmentset -e
if [ -n"$1" ];then
VENV_PATH="$1"elif [ -n"$VIRTUAL_ENV" ];then
VENV_PATH="$VIRTUAL_ENV"elseecho"Error: No virtual environment specified and none is activated."echo"Usage: $0 [venv_path]"exit 1
fiif [ !-d"$VENV_PATH" ];thenecho"Error: Directory '$VENV_PATH' does not exist."exit 1
fi# Find site-packages directory (handles different Python versions)
SITE_PACKAGES=$(find "$VENV_PATH/lib" -type d -name "site-packages"2>/dev/null | head -1)if [ -z"$SITE_PACKAGES" ];thenecho"Error: Could not find site-packages in '$VENV_PATH'"exit 1
fi
SITECUSTOMIZE="$SITE_PACKAGES/sitecustomize.py"
cat >"$SITECUSTOMIZE"<< 'EOF'import warnings# Patch warn_original_warn = warnings.warndef _quiet_warn(message, category=UserWarning, stacklevel=1, source=None): if category is DeprecationWarning or (isinstance(category, type) and issubclass(category, DeprecationWarning)): msg_str = str(message) if "ssl" in msg_str.lower() or "protocol_tls" in msg_str.lower(): return return _original_warn(message, category, stacklevel, source)warnings.warn = _quiet_warn# Also patch showwarning (the output function)_original_showwarning = warnings.showwarningdef _quiet_showwarning(message, category, filename, lineno, file=None, line=None): if category is DeprecationWarning or (isinstance(category, type) and issubclass(category, DeprecationWarning)): msg_str = str(message) if "ssl" in msg_str.lower() or "protocol_tls" in msg_str.lower(): return return _original_showwarning(message, category, filename, lineno, file, line)warnings.showwarning = _quiet_showwarningEOFecho"Created $SITECUSTOMIZE"echo"SSL deprecation warnings will now be suppressed in this environment."
Activity
sbailliez commentedon Apr 20, 2025
I can confirm @robmcd issue. 2.1.5 as well and console is flooded, the inability to even disable this with PYTHONWARNINGS makes the experience suboptimal for python > 3.9
ad-m-ss commentedon May 28, 2025
This is caused by reverting fix for it by @Brooke-white in 462964a .
karlthumm commentedon Jul 29, 2025
I confirm I have this happening on redshift-connector 2.1.8.
Every run throws throws the following warning:
This leads to thousands of lines in the console that is not helpful and detracts from being able to see the information that's important.
allyxsvenkeson commentedon Dec 16, 2025
I'm also experiencing this on redshift-connector 2.1.8.
During every run it gives me these errors multiple times
sbailliez commentedon Jan 24, 2026
This has been going on for ages and is been ignored by the team. To avoid this issue, you can copy the script below and save it as
suppress-deprecation-warnings.sh. Execute it and it will copy a file sitecustomize.py in site-packages directory and it sets a filter to suppress the messages. Using PYTHONWARNINGS does not work otherwise.