methew / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

non-static Connection_New conflicts with other modules, e.g., multiprocessing #352

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import multiprocessing
2. import pyodbc
3. conn = pyodbc.connect(<your_dsn>)
4. print type(conn)

What is the expected output? What do you see instead?
Expected: pyodbc.Connection
Get: _multiprocessing.Connection

What version of the product are you using? On what operating system?
Using version 3.0.7 on python 2.7.5 on RHEL 6.

Please provide any additional information below.

It appears that both pyodbc and multiprocessing have non-static Connection_New 
functions that conflict with one another.  I've hacked pyodbc so that the 
function is called pyodbc_Connection_New.

Original issue reported on code.google.com by jeremy.m...@gmail.com on 2 Jan 2014 at 8:58

GoogleCodeExporter commented 9 years ago
I jumped the gun, the problem is actually with the ConnectionType struct.  Both 
modules declare non-static ConnectionType structs, so, depending on order of 
import, either pyodbc's is used or multiprocessing's is used.

Original comment by jeremy.m...@gmail.com on 2 Jan 2014 at 9:33