File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 139
139
# Default value for serverMonitoringMode
140
140
SERVER_MONITORING_MODE = "auto" # poll/stream/auto
141
141
142
+ # Options that must raise an error instead of warning if they invalidate.
143
+ _OPTION_MUST_RAISE = ["CANONICALIZE_HOST_NAME" ]
144
+
142
145
143
146
def partition_node (node : str ) -> tuple [str , int ]:
144
147
"""Split a host:port string into (host, int(port)) pair."""
@@ -870,7 +873,7 @@ def get_setter_key(x: str) -> str:
870
873
validator = _get_validator (opt , URI_OPTIONS_VALIDATOR_MAP , normed_key = normed_key )
871
874
validated = validator (opt , value )
872
875
except (ValueError , TypeError , ConfigurationError ) as exc :
873
- if warn :
876
+ if warn and opt not in _OPTION_MUST_RAISE :
874
877
warnings .warn (str (exc ), stacklevel = 2 )
875
878
else :
876
879
raise
You can’t perform that action at this time.
0 commit comments