mssql-python 1.0.0__cp314-cp314-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mssql_python/__init__.py +307 -0
- mssql_python/auth.py +222 -0
- mssql_python/connection.py +1493 -0
- mssql_python/connection_string_builder.py +113 -0
- mssql_python/connection_string_parser.py +381 -0
- mssql_python/constants.py +509 -0
- mssql_python/cursor.py +2601 -0
- mssql_python/db_connection.py +53 -0
- mssql_python/ddbc_bindings.cp314-amd64.pyd +0 -0
- mssql_python/ddbc_bindings.py +137 -0
- mssql_python/exceptions.py +574 -0
- mssql_python/helpers.py +357 -0
- mssql_python/libs/LICENSING +19 -0
- mssql_python/libs/linux/alpine/arm64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/alpine/arm64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/alpine/arm64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/alpine/arm64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/alpine/x86_64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/alpine/x86_64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/alpine/x86_64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/alpine/x86_64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/debian_ubuntu/arm64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/debian_ubuntu/arm64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/debian_ubuntu/arm64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/debian_ubuntu/arm64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/debian_ubuntu/x86_64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/debian_ubuntu/x86_64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/debian_ubuntu/x86_64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/debian_ubuntu/x86_64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/rhel/arm64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/rhel/arm64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/rhel/arm64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/rhel/arm64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/rhel/x86_64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/linux/rhel/x86_64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/rhel/x86_64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/rhel/x86_64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/linux/suse/x86_64/lib/libmsodbcsql-18.5.so.1.1 +0 -0
- mssql_python/libs/linux/suse/x86_64/lib/libodbcinst.so.2 +0 -0
- mssql_python/libs/linux/suse/x86_64/share/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/macos/arm64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/macos/arm64/lib/libltdl.7.dylib +0 -0
- mssql_python/libs/macos/arm64/lib/libmsodbcsql.18.dylib +0 -0
- mssql_python/libs/macos/arm64/lib/libodbc.2.dylib +0 -0
- mssql_python/libs/macos/arm64/lib/libodbcinst.2.dylib +0 -0
- mssql_python/libs/macos/arm64/share/doc/msodbcsql18/LICENSE.txt +101 -0
- mssql_python/libs/macos/arm64/share/doc/msodbcsql18/RELEASE_NOTES +465 -0
- mssql_python/libs/macos/arm64/share/msodbcsql18/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/macos/x86_64/lib/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/macos/x86_64/lib/libltdl.7.dylib +0 -0
- mssql_python/libs/macos/x86_64/lib/libmsodbcsql.18.dylib +0 -0
- mssql_python/libs/macos/x86_64/lib/libodbc.2.dylib +0 -0
- mssql_python/libs/macos/x86_64/lib/libodbcinst.2.dylib +0 -0
- mssql_python/libs/macos/x86_64/share/doc/msodbcsql18/LICENSE.txt +101 -0
- mssql_python/libs/macos/x86_64/share/doc/msodbcsql18/RELEASE_NOTES +465 -0
- mssql_python/libs/macos/x86_64/share/msodbcsql18/resources/en_US/msodbcsqlr18.rll +0 -0
- mssql_python/libs/windows/x64/1033/msodbcsqlr18.rll +0 -0
- mssql_python/libs/windows/x64/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt +76 -0
- mssql_python/libs/windows/x64/MICROSOFT_VISUAL_STUDIO_LICENSE.txt +54 -0
- mssql_python/libs/windows/x64/msodbcdiag18.dll +0 -0
- mssql_python/libs/windows/x64/msodbcsql18.dll +0 -0
- mssql_python/libs/windows/x64/mssql-auth.dll +0 -0
- mssql_python/logging.py +610 -0
- mssql_python/mssql_python.pyi +375 -0
- mssql_python/msvcp140.dll +0 -0
- mssql_python/pooling.py +125 -0
- mssql_python/row.py +194 -0
- mssql_python/type.py +143 -0
- mssql_python-1.0.0.dist-info/METADATA +76 -0
- mssql_python-1.0.0.dist-info/RECORD +73 -0
- mssql_python-1.0.0.dist-info/WHEEL +5 -0
- mssql_python-1.0.0.dist-info/licenses/LICENSE +47 -0
- mssql_python-1.0.0.dist-info/top_level.txt +1 -0
mssql_python/helpers.py
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
Licensed under the MIT license.
|
|
4
|
+
This module provides helper functions for the mssql_python package.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import re
|
|
8
|
+
import threading
|
|
9
|
+
import locale
|
|
10
|
+
from typing import Any, Union, Tuple, Optional
|
|
11
|
+
from mssql_python import ddbc_bindings
|
|
12
|
+
from mssql_python.exceptions import raise_exception
|
|
13
|
+
from mssql_python.logging import logger
|
|
14
|
+
from mssql_python.constants import ConstantsDDBC
|
|
15
|
+
# normalize_architecture import removed as it's unused
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def add_driver_to_connection_str(connection_str: str) -> str:
|
|
19
|
+
"""
|
|
20
|
+
Add the DDBC driver to the connection string if not present.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
connection_str (str): The original connection string.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
str: The connection string with the DDBC driver added.
|
|
27
|
+
|
|
28
|
+
Raises:
|
|
29
|
+
Exception: If the connection string is invalid.
|
|
30
|
+
"""
|
|
31
|
+
logger.debug('add_driver_to_connection_str: Processing connection string (length=%d)', len(connection_str))
|
|
32
|
+
driver_name = "Driver={ODBC Driver 18 for SQL Server}"
|
|
33
|
+
try:
|
|
34
|
+
# Strip any leading or trailing whitespace from the connection string
|
|
35
|
+
connection_str = connection_str.strip()
|
|
36
|
+
connection_str = add_driver_name_to_app_parameter(connection_str)
|
|
37
|
+
|
|
38
|
+
# Split the connection string into individual attributes
|
|
39
|
+
connection_attributes = connection_str.split(";")
|
|
40
|
+
final_connection_attributes = []
|
|
41
|
+
|
|
42
|
+
# Iterate through the attributes and exclude any existing driver attribute
|
|
43
|
+
driver_found = False
|
|
44
|
+
for attribute in connection_attributes:
|
|
45
|
+
if attribute.lower().split("=")[0] == "driver":
|
|
46
|
+
driver_found = True
|
|
47
|
+
logger.debug('add_driver_to_connection_str: Existing driver attribute found, removing')
|
|
48
|
+
continue
|
|
49
|
+
final_connection_attributes.append(attribute)
|
|
50
|
+
|
|
51
|
+
# Join the remaining attributes back into a connection string
|
|
52
|
+
connection_str = ";".join(final_connection_attributes)
|
|
53
|
+
|
|
54
|
+
# Insert the driver attribute at the beginning of the connection string
|
|
55
|
+
final_connection_attributes.insert(0, driver_name)
|
|
56
|
+
connection_str = ";".join(final_connection_attributes)
|
|
57
|
+
logger.debug('add_driver_to_connection_str: Driver added (had_existing=%s, attr_count=%d)',
|
|
58
|
+
str(driver_found), len(final_connection_attributes))
|
|
59
|
+
|
|
60
|
+
except Exception as e:
|
|
61
|
+
logger.debug('add_driver_to_connection_str: Failed to process connection string - %s', str(e))
|
|
62
|
+
raise ValueError(
|
|
63
|
+
"Invalid connection string, Please follow the format: "
|
|
64
|
+
"Server=server_name;Database=database_name;UID=user_name;PWD=password"
|
|
65
|
+
) from e
|
|
66
|
+
|
|
67
|
+
return connection_str
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def check_error(handle_type: int, handle: Any, ret: int) -> None:
|
|
71
|
+
"""
|
|
72
|
+
Check for errors and raise an exception if an error is found.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
handle_type: The type of the handle (e.g., SQL_HANDLE_ENV, SQL_HANDLE_DBC).
|
|
76
|
+
handle: The SqlHandle object associated with the operation.
|
|
77
|
+
ret: The return code from the DDBC function call.
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
RuntimeError: If an error is found.
|
|
81
|
+
"""
|
|
82
|
+
if ret < 0:
|
|
83
|
+
logger.debug('check_error: Error detected - handle_type=%d, return_code=%d', handle_type, ret)
|
|
84
|
+
error_info = ddbc_bindings.DDBCSQLCheckError(handle_type, handle, ret)
|
|
85
|
+
logger.error("Error: %s", error_info.ddbcErrorMsg)
|
|
86
|
+
logger.debug('check_error: SQL state=%s', error_info.sqlState)
|
|
87
|
+
raise_exception(error_info.sqlState, error_info.ddbcErrorMsg)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def add_driver_name_to_app_parameter(connection_string: str) -> str:
|
|
91
|
+
"""
|
|
92
|
+
Modifies the input connection string by appending the APP name.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
connection_string (str): The input connection string.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
str: The modified connection string.
|
|
99
|
+
"""
|
|
100
|
+
logger.debug('add_driver_name_to_app_parameter: Processing connection string')
|
|
101
|
+
# Split the input string into key-value pairs
|
|
102
|
+
parameters = connection_string.split(";")
|
|
103
|
+
|
|
104
|
+
# Initialize variables
|
|
105
|
+
app_found = False
|
|
106
|
+
modified_parameters = []
|
|
107
|
+
|
|
108
|
+
# Iterate through the key-value pairs
|
|
109
|
+
for param in parameters:
|
|
110
|
+
if param.lower().startswith("app="):
|
|
111
|
+
# Overwrite the value with 'MSSQL-Python'
|
|
112
|
+
app_found = True
|
|
113
|
+
key, _ = param.split("=", 1)
|
|
114
|
+
modified_parameters.append(f"{key}=MSSQL-Python")
|
|
115
|
+
logger.debug('add_driver_name_to_app_parameter: Existing APP parameter overwritten')
|
|
116
|
+
else:
|
|
117
|
+
# Keep other parameters as is
|
|
118
|
+
modified_parameters.append(param)
|
|
119
|
+
|
|
120
|
+
# If APP key is not found, append it
|
|
121
|
+
if not app_found:
|
|
122
|
+
modified_parameters.append("APP=MSSQL-Python")
|
|
123
|
+
logger.debug('add_driver_name_to_app_parameter: APP parameter added')
|
|
124
|
+
|
|
125
|
+
# Join the parameters back into a connection string
|
|
126
|
+
return ";".join(modified_parameters) + ";"
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def sanitize_connection_string(conn_str: str) -> str:
|
|
130
|
+
"""
|
|
131
|
+
Sanitize the connection string by removing sensitive information.
|
|
132
|
+
Args:
|
|
133
|
+
conn_str (str): The connection string to sanitize.
|
|
134
|
+
Returns:
|
|
135
|
+
str: The sanitized connection string.
|
|
136
|
+
"""
|
|
137
|
+
logger.debug('sanitize_connection_string: Sanitizing connection string (length=%d)', len(conn_str))
|
|
138
|
+
# Remove sensitive information from the connection string, Pwd section
|
|
139
|
+
# Replace Pwd=...; or Pwd=... (end of string) with Pwd=***;
|
|
140
|
+
sanitized = re.sub(r"(Pwd\s*=\s*)[^;]*", r"\1***", conn_str, flags=re.IGNORECASE)
|
|
141
|
+
logger.debug('sanitize_connection_string: Password fields masked')
|
|
142
|
+
return sanitized
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def sanitize_user_input(user_input: str, max_length: int = 50) -> str:
|
|
146
|
+
"""
|
|
147
|
+
Sanitize user input for safe logging by removing control characters,
|
|
148
|
+
limiting length, and ensuring safe characters only.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
user_input (str): The user input to sanitize.
|
|
152
|
+
max_length (int): Maximum length of the sanitized output.
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
str: The sanitized string safe for logging.
|
|
156
|
+
"""
|
|
157
|
+
logger.debug('sanitize_user_input: Sanitizing input (type=%s, length=%d)',
|
|
158
|
+
type(user_input).__name__, len(user_input) if isinstance(user_input, str) else 0)
|
|
159
|
+
if not isinstance(user_input, str):
|
|
160
|
+
logger.debug('sanitize_user_input: Non-string input detected')
|
|
161
|
+
return "<non-string>"
|
|
162
|
+
|
|
163
|
+
# Remove control characters and non-printable characters
|
|
164
|
+
# Allow alphanumeric, dash, underscore, and dot (common in encoding names)
|
|
165
|
+
sanitized = re.sub(r"[^\w\-\.]", "", user_input)
|
|
166
|
+
|
|
167
|
+
# Limit length to prevent log flooding
|
|
168
|
+
was_truncated = False
|
|
169
|
+
if len(sanitized) > max_length:
|
|
170
|
+
sanitized = sanitized[:max_length] + "..."
|
|
171
|
+
was_truncated = True
|
|
172
|
+
|
|
173
|
+
# Return placeholder if nothing remains after sanitization
|
|
174
|
+
result = sanitized if sanitized else "<invalid>"
|
|
175
|
+
logger.debug('sanitize_user_input: Result length=%d, truncated=%s', len(result), str(was_truncated))
|
|
176
|
+
return result
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def validate_attribute_value(
|
|
180
|
+
attribute: Union[int, str],
|
|
181
|
+
value: Union[int, str, bytes, bytearray],
|
|
182
|
+
is_connected: bool = True,
|
|
183
|
+
sanitize_logs: bool = True,
|
|
184
|
+
max_log_length: int = 50,
|
|
185
|
+
) -> Tuple[bool, Optional[str], str, str]:
|
|
186
|
+
"""
|
|
187
|
+
Validates attribute and value pairs for connection attributes.
|
|
188
|
+
|
|
189
|
+
Performs basic type checking and validation of ODBC connection attributes.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
attribute (int): The connection attribute to validate (SQL_ATTR_*)
|
|
193
|
+
value: The value to set for the attribute (int, str, bytes, or bytearray)
|
|
194
|
+
is_connected (bool): Whether the connection is already established
|
|
195
|
+
sanitize_logs (bool): Whether to include sanitized versions for logging
|
|
196
|
+
max_log_length (int): Maximum length of sanitized output for logging
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
tuple: (is_valid, error_message, sanitized_attribute, sanitized_value)
|
|
200
|
+
"""
|
|
201
|
+
logger.debug('validate_attribute_value: Validating attribute=%s, value_type=%s, is_connected=%s',
|
|
202
|
+
str(attribute), type(value).__name__, str(is_connected))
|
|
203
|
+
|
|
204
|
+
# Sanitize a value for logging
|
|
205
|
+
def _sanitize_for_logging(input_val: Any, max_length: int = max_log_length) -> str:
|
|
206
|
+
if not isinstance(input_val, str):
|
|
207
|
+
try:
|
|
208
|
+
input_val = str(input_val)
|
|
209
|
+
except (TypeError, ValueError):
|
|
210
|
+
return "<non-string>"
|
|
211
|
+
|
|
212
|
+
# Allow alphanumeric, dash, underscore, and dot
|
|
213
|
+
sanitized = re.sub(r"[^\w\-\.]", "", input_val)
|
|
214
|
+
|
|
215
|
+
# Limit length
|
|
216
|
+
if len(sanitized) > max_length:
|
|
217
|
+
sanitized = sanitized[:max_length] + "..."
|
|
218
|
+
|
|
219
|
+
return sanitized if sanitized else "<invalid>"
|
|
220
|
+
|
|
221
|
+
# Create sanitized versions for logging
|
|
222
|
+
sanitized_attr = (
|
|
223
|
+
_sanitize_for_logging(attribute) if sanitize_logs else str(attribute)
|
|
224
|
+
)
|
|
225
|
+
sanitized_val = _sanitize_for_logging(value) if sanitize_logs else str(value)
|
|
226
|
+
|
|
227
|
+
# Basic attribute validation - must be an integer
|
|
228
|
+
if not isinstance(attribute, int):
|
|
229
|
+
logger.debug('validate_attribute_value: Attribute not an integer - type=%s', type(attribute).__name__)
|
|
230
|
+
return (
|
|
231
|
+
False,
|
|
232
|
+
f"Attribute must be an integer, got {type(attribute).__name__}",
|
|
233
|
+
sanitized_attr,
|
|
234
|
+
sanitized_val,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
# Define driver-level attributes that are supported
|
|
238
|
+
supported_attributes = [
|
|
239
|
+
ConstantsDDBC.SQL_ATTR_ACCESS_MODE.value,
|
|
240
|
+
ConstantsDDBC.SQL_ATTR_CONNECTION_TIMEOUT.value,
|
|
241
|
+
ConstantsDDBC.SQL_ATTR_CURRENT_CATALOG.value,
|
|
242
|
+
ConstantsDDBC.SQL_ATTR_LOGIN_TIMEOUT.value,
|
|
243
|
+
ConstantsDDBC.SQL_ATTR_PACKET_SIZE.value,
|
|
244
|
+
ConstantsDDBC.SQL_ATTR_TXN_ISOLATION.value,
|
|
245
|
+
]
|
|
246
|
+
|
|
247
|
+
# Check if attribute is supported
|
|
248
|
+
if attribute not in supported_attributes:
|
|
249
|
+
logger.debug('validate_attribute_value: Unsupported attribute - attr=%d', attribute)
|
|
250
|
+
return (
|
|
251
|
+
False,
|
|
252
|
+
f"Unsupported attribute: {attribute}",
|
|
253
|
+
sanitized_attr,
|
|
254
|
+
sanitized_val,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
# Check timing constraints for these specific attributes
|
|
258
|
+
before_only_attributes = [
|
|
259
|
+
ConstantsDDBC.SQL_ATTR_LOGIN_TIMEOUT.value,
|
|
260
|
+
ConstantsDDBC.SQL_ATTR_PACKET_SIZE.value,
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
# Check if attribute can be set at the current connection state
|
|
264
|
+
if is_connected and attribute in before_only_attributes:
|
|
265
|
+
logger.debug('validate_attribute_value: Timing violation - attr=%d cannot be set after connection', attribute)
|
|
266
|
+
return (
|
|
267
|
+
False,
|
|
268
|
+
(
|
|
269
|
+
f"Attribute {attribute} must be set before connection establishment. "
|
|
270
|
+
"Use the attrs_before parameter when creating the connection."
|
|
271
|
+
),
|
|
272
|
+
sanitized_attr,
|
|
273
|
+
sanitized_val,
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
# Basic value type validation
|
|
277
|
+
if isinstance(value, int):
|
|
278
|
+
# For integer values, check if negative (login timeout can be -1 for default)
|
|
279
|
+
if value < 0 and attribute != ConstantsDDBC.SQL_ATTR_LOGIN_TIMEOUT.value:
|
|
280
|
+
return (
|
|
281
|
+
False,
|
|
282
|
+
f"Integer value cannot be negative: {value}",
|
|
283
|
+
sanitized_attr,
|
|
284
|
+
sanitized_val,
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
elif isinstance(value, str):
|
|
288
|
+
# Basic string length check
|
|
289
|
+
max_string_size = 8192 # 8KB maximum
|
|
290
|
+
if len(value) > max_string_size:
|
|
291
|
+
return (
|
|
292
|
+
False,
|
|
293
|
+
f"String value too large: {len(value)} bytes (max {max_string_size})",
|
|
294
|
+
sanitized_attr,
|
|
295
|
+
sanitized_val,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
elif isinstance(value, (bytes, bytearray)):
|
|
299
|
+
# Basic binary length check
|
|
300
|
+
max_binary_size = 32768 # 32KB maximum
|
|
301
|
+
if len(value) > max_binary_size:
|
|
302
|
+
return (
|
|
303
|
+
False,
|
|
304
|
+
f"Binary value too large: {len(value)} bytes (max {max_binary_size})",
|
|
305
|
+
sanitized_attr,
|
|
306
|
+
sanitized_val,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
else:
|
|
310
|
+
# Reject unsupported value types
|
|
311
|
+
return (
|
|
312
|
+
False,
|
|
313
|
+
f"Unsupported attribute value type: {type(value).__name__}",
|
|
314
|
+
sanitized_attr,
|
|
315
|
+
sanitized_val,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# All basic validations passed
|
|
319
|
+
logger.debug('validate_attribute_value: Validation passed - attr=%d, value_type=%s', attribute, type(value).__name__)
|
|
320
|
+
return True, None, sanitized_attr, sanitized_val
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
# Settings functionality moved here to avoid circular imports
|
|
324
|
+
|
|
325
|
+
# Initialize the locale setting only once at module import time
|
|
326
|
+
# This avoids thread-safety issues with locale
|
|
327
|
+
_default_decimal_separator: str = "."
|
|
328
|
+
try:
|
|
329
|
+
# Get the locale setting once during module initialization
|
|
330
|
+
locale_separator = locale.localeconv()["decimal_point"]
|
|
331
|
+
if locale_separator and len(locale_separator) == 1:
|
|
332
|
+
_default_decimal_separator = locale_separator
|
|
333
|
+
except (AttributeError, KeyError, TypeError, ValueError):
|
|
334
|
+
pass # Keep the default "." if locale access fails
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
class Settings:
|
|
338
|
+
"""
|
|
339
|
+
Settings class for mssql_python package configuration.
|
|
340
|
+
|
|
341
|
+
This class holds global settings that affect the behavior of the package,
|
|
342
|
+
including lowercase column names, decimal separator.
|
|
343
|
+
"""
|
|
344
|
+
def __init__(self) -> None:
|
|
345
|
+
self.lowercase: bool = False
|
|
346
|
+
# Use the pre-determined separator - no locale access here
|
|
347
|
+
self.decimal_separator: str = _default_decimal_separator
|
|
348
|
+
|
|
349
|
+
# Global settings instance
|
|
350
|
+
_settings: Settings = Settings()
|
|
351
|
+
_settings_lock: threading.Lock = threading.Lock()
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def get_settings() -> Settings:
|
|
355
|
+
"""Return the global settings object"""
|
|
356
|
+
with _settings_lock:
|
|
357
|
+
return _settings
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
A. The dynamic-link libraries (DLLs) in the mssql_python\libs\win folder fall under different Microsoft licenses.
|
|
2
|
+
====================================================================================================
|
|
3
|
+
Below is a breakdown of these components by their respective licenses.
|
|
4
|
+
|
|
5
|
+
1. Microsoft ODBC Driver 18 End User License Agreement (EULA)
|
|
6
|
+
These components are part of the Microsoft ODBC Driver 18 for SQL Server and are governed by the Microsoft ODBC Driver 18 EULA.
|
|
7
|
+
|
|
8
|
+
- msodbcsqlr18.rll – Resource library containing localized error messages for the ODBC driver.
|
|
9
|
+
- msodbcdiag18.dll – Diagnostic library for handling error reporting and troubleshooting.
|
|
10
|
+
- msodbcsql18.dll – Core ODBC driver enabling connectivity between SQL Server and applications.
|
|
11
|
+
|
|
12
|
+
For official licensing terms, refer to: mssql_python\libs\win\MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt
|
|
13
|
+
|
|
14
|
+
2. Microsoft Visual C++ Redistributable EULA
|
|
15
|
+
These components are part of the Microsoft Visual C++ Redistributable and are governed by the Microsoft Visual C++ Redistributable EULA.
|
|
16
|
+
|
|
17
|
+
- msvcp140.dll – Microsoft C++ Standard Library runtime, required for running C++ applications.
|
|
18
|
+
|
|
19
|
+
For redistribution and usage terms, refer to: mssql_python\libs\win\MICROSOFT_VISUAL_STUDIO_LICENSE.txt
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
MICROSOFT SOFTWARE LICENSE TERMS
|
|
2
|
+
MICROSOFT ODBC DRIVER 18 FOR SQL SERVER
|
|
3
|
+
|
|
4
|
+
These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
|
|
5
|
+
|
|
6
|
+
1. INSTALLATION AND USE RIGHTS.
|
|
7
|
+
|
|
8
|
+
a) General. You may install and use any number of copies of the software to develop and test your applications.
|
|
9
|
+
b) Third Party Software. The software may include third party applications that Microsoft, not the third party, licenses to you under this agreement. Any included notices for third party applications are for your information only.
|
|
10
|
+
|
|
11
|
+
2. DISTRIBUTABLE CODE. The software may contain code you are permitted to distribute (i.e. make available for third parties) in applications you develop, as described in this Section.
|
|
12
|
+
|
|
13
|
+
a) Distribution Rights. The code and test files described below are distributable if included with the software.
|
|
14
|
+
|
|
15
|
+
i. REDIST.TXT Files. You may copy and distribute the object code form of code listed on the REDIST list in the software, if any, or listed at REDIST (https://aka.ms/odbc18eularedist);
|
|
16
|
+
ii. Image Library. You may copy and distribute images, graphics, and animations in the Image Library as described in the software documentation;
|
|
17
|
+
iii. Sample Code, Templates, and Styles. You may copy, modify, and distribute the source and object code form of code marked as “sample”, “template”, “simple styles”, and “sketch styles”; and
|
|
18
|
+
iv. Third Party Distribution. You may permit distributors of your applications to copy and distribute any of this distributable code you elect to distribute with your applications.
|
|
19
|
+
|
|
20
|
+
b) Distribution Requirements. For any code you distribute, you must:
|
|
21
|
+
|
|
22
|
+
i. add significant primary functionality to it in your applications;
|
|
23
|
+
ii. require distributors and external end users to agree to terms that protect it and Microsoft at least as much as this agreement; and
|
|
24
|
+
iii. indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your applications, except to the extent that any claim is based solely on the unmodified distributable code.
|
|
25
|
+
|
|
26
|
+
c) Distribution Restrictions. You may not:
|
|
27
|
+
|
|
28
|
+
i. use Microsoft’s trademarks or trade dress in your application in any way that suggests your application comes from or is endorsed by Microsoft; or
|
|
29
|
+
ii. modify or distribute the source code of any distributable code so that any part of it becomes subject to any license that requires that the distributable code, any other part of the software, or any of Microsoft’s other intellectual property be disclosed or distributed in source code form, or that others have the right to modify it.
|
|
30
|
+
|
|
31
|
+
3. DATA COLLECTION. Some features in the software may enable collection of data from users of your applications that access or use the software. If you use these features to enable data collection in your applications, you must comply with applicable law, including getting any required user consent, and maintain a prominent privacy policy that accurately informs users about how you use, collect, and share their data. You agree to comply with all applicable provisions of the Microsoft Privacy Statement at [https://go.microsoft.com/fwlink/?LinkId=521839].
|
|
32
|
+
|
|
33
|
+
4. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to):
|
|
34
|
+
|
|
35
|
+
d) use the software in any way that is against the law or to create or propagate malware; or
|
|
36
|
+
e) share, publish, distribute, or lend the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone hosted solution for others to use, or transfer the software or this agreement to any third party.
|
|
37
|
+
|
|
38
|
+
5. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit http://aka.ms/exporting.
|
|
39
|
+
|
|
40
|
+
6. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
|
|
41
|
+
|
|
42
|
+
7. UPDATES. The software may periodically check for updates, and download and install them for you. You may obtain updates only from Microsoft or authorized sources. Microsoft may need to update your system to provide you with updates. You agree to receive these automatic updates without any additional notice. Updates may not include or support all existing software features, services, or peripheral devices.
|
|
43
|
+
|
|
44
|
+
8. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software.
|
|
45
|
+
|
|
46
|
+
9. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles. If you acquired the software in any other country, its laws apply. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court. If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court.
|
|
47
|
+
|
|
48
|
+
10. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you:
|
|
49
|
+
|
|
50
|
+
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights.
|
|
51
|
+
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software.
|
|
52
|
+
c) Germany and Austria.
|
|
53
|
+
|
|
54
|
+
i. Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software.
|
|
55
|
+
ii. Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law.
|
|
56
|
+
|
|
57
|
+
Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence.
|
|
58
|
+
|
|
59
|
+
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
60
|
+
|
|
61
|
+
12. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT, OR INCIDENTAL DAMAGES.
|
|
62
|
+
|
|
63
|
+
This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law.
|
|
64
|
+
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages.
|
|
65
|
+
Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French.
|
|
66
|
+
Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
|
|
67
|
+
|
|
68
|
+
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
|
|
69
|
+
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
|
|
70
|
+
|
|
71
|
+
Cette limitation concerne:
|
|
72
|
+
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et
|
|
73
|
+
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
|
|
74
|
+
|
|
75
|
+
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
|
|
76
|
+
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
MICROSOFT SOFTWARE LICENSE TERMS
|
|
2
|
+
MICROSOFT ODBC DRIVER 18 FOR SQL SERVER
|
|
3
|
+
|
|
4
|
+
These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
|
|
5
|
+
|
|
6
|
+
1. INSTALLATION AND USE RIGHTS.
|
|
7
|
+
|
|
8
|
+
a) General. You may install and use any number of copies of the software to develop and test your applications.
|
|
9
|
+
b) Third Party Software. The software may include third party applications that Microsoft, not the third party, licenses to you under this agreement. Any included notices for third party applications are for your information only.
|
|
10
|
+
|
|
11
|
+
2. DISTRIBUTABLE CODE. The software may contain code you are permitted to distribute (i.e. make available for third parties) in applications you develop, as described in this Section.
|
|
12
|
+
|
|
13
|
+
a) Distribution Rights. The code and test files described below are distributable if included with the software.
|
|
14
|
+
|
|
15
|
+
i. REDIST.TXT Files. You may copy and distribute the object code form of code listed on the REDIST list in the software, if any, or listed at REDIST (https://aka.ms/odbc18eularedist);
|
|
16
|
+
ii. Image Library. You may copy and distribute images, graphics, and animations in the Image Library as described in the software documentation;
|
|
17
|
+
iii. Sample Code, Templates, and Styles. You may copy, modify, and distribute the source and object code form of code marked as “sample”, “template”, “simple styles”, and “sketch styles”; and
|
|
18
|
+
iv. Third Party Distribution. You may permit distributors of your applications to copy and distribute any of this distributable code you elect to distribute with your applications.
|
|
19
|
+
|
|
20
|
+
b) Distribution Requirements. For any code you distribute, you must:
|
|
21
|
+
|
|
22
|
+
i. add significant primary functionality to it in your applications;
|
|
23
|
+
ii. require distributors and external end users to agree to terms that protect it and Microsoft at least as much as this agreement; and
|
|
24
|
+
iii. indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your applications, except to the extent that any claim is based solely on the unmodified distributable code.
|
|
25
|
+
|
|
26
|
+
c) Distribution Restrictions. You may not:
|
|
27
|
+
|
|
28
|
+
i. use Microsoft’s trademarks or trade dress in your application in any way that suggests your application comes from or is endorsed by Microsoft; or
|
|
29
|
+
ii. modify or distribute the source code of any distributable code so that any part of it becomes subject to any license that requires that the distributable code, any other part of the software, or any of Microsoft’s other intellectual property be disclosed or distributed in source code form, or that others have the right to modify it.
|
|
30
|
+
|
|
31
|
+
3. DATA COLLECTION. Some features in the software may enable collection of data from users of your applications that access or use the software. If you use these features to enable data collection in your applications, you must comply with applicable law, including getting any required user consent, and maintain a prominent privacy policy that accurately informs users about how you use, collect, and share their data. You agree to comply with all applicable provisions of the Microsoft Privacy Statement at [https://go.microsoft.com/fwlink/?LinkId=521839].
|
|
32
|
+
|
|
33
|
+
4. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to):
|
|
34
|
+
|
|
35
|
+
d) use the software in any way that is against the law or to create or propagate malware; or
|
|
36
|
+
e) share, publish, distribute, or lend the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone hosted solution for others to use, or transfer the software or this agreement to any third party.
|
|
37
|
+
|
|
38
|
+
5. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit http://aka.ms/exporting.
|
|
39
|
+
|
|
40
|
+
6. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
|
|
41
|
+
|
|
42
|
+
7. UPDATES. The software may periodically check for updates, and download and install them for you. You may obtain updates only from Microsoft or authorized sources. Microsoft may need to update your system to provide you with updates. You agree to receive these automatic updates without any additional notice. Updates may not include or support all existing software features, services, or peripheral devices.
|
|
43
|
+
|
|
44
|
+
8. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software.
|
|
45
|
+
|
|
46
|
+
9. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles. If you acquired the software in any other country, its laws apply. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court. If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court.
|
|
47
|
+
|
|
48
|
+
10. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you:
|
|
49
|
+
|
|
50
|
+
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights.
|
|
51
|
+
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software.
|
|
52
|
+
c) Germany and Austria.
|
|
53
|
+
|
|
54
|
+
i. Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software.
|
|
55
|
+
ii. Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law.
|
|
56
|
+
|
|
57
|
+
Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence.
|
|
58
|
+
|
|
59
|
+
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
60
|
+
|
|
61
|
+
12. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT, OR INCIDENTAL DAMAGES.
|
|
62
|
+
|
|
63
|
+
This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law.
|
|
64
|
+
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages.
|
|
65
|
+
Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French.
|
|
66
|
+
Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
|
|
67
|
+
|
|
68
|
+
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
|
|
69
|
+
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
|
|
70
|
+
|
|
71
|
+
Cette limitation concerne:
|
|
72
|
+
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et
|
|
73
|
+
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
|
|
74
|
+
|
|
75
|
+
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
|
|
76
|
+
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
|
|
Binary file
|
|
Binary file
|