Describe the bug
If an exception generated by mssql-python is pickled, the following error will occur on unpickle:
[error].__init__() missing 1 required positional argument: 'ddbc_error'
This causes issues when using e.g. multiprocessing and attempting to marshal errors back to a central process.
To reproduce
import mssql_python, pickle
conn = mssql_python.connect("conn_string_here")
cur = conn.cursor()
try:
cur.execute('insert into fake_tbl values (123)')
except Exception as e:
d = pickle.dumps(e)
ex = pickle.loads(d)
Expected behavior
The pickled exception should cleanly unpickle, and then I should be able to treat it just like any other exception object.
Further technical details
Python version: 3.12.3
SQL Server version: N/A
Operating system: N/A
Describe the bug
If an exception generated by mssql-python is pickled, the following error will occur on unpickle:
[error].__init__() missing 1 required positional argument: 'ddbc_error'This causes issues when using e.g. multiprocessing and attempting to marshal errors back to a central process.
To reproduce
Expected behavior
The pickled exception should cleanly unpickle, and then I should be able to treat it just like any other exception object.
Further technical details
Python version: 3.12.3
SQL Server version: N/A
Operating system: N/A