Oracle and Python
Bill Scherer
Bill.Scherer at VerizonWireless.com
Fri Sep 1 09:46:46 EDT 2000
Philip Rodgers wrote:
<snip>
> Python 1.6b1 (#1, Aug 31 2000, 13:50:21) [GCC egcs-2.91.66 19990314/Linux] on linux2
> Copyright (c) Corporation for National Research Initiatives.
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
> >>> import DCOracle
> >>> db = DCOracle.Connect("myuser/mypass at iphonex")
> >>> cursor = db.cursor()
> >>> cursor.execute("select distinct owner from sys.all_tables")
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/local/lib/python1.6/DCOracle/ociCurs.py", line 271, in execute
> r = self._execute(params__, kw)
> File "/usr/local/lib/python1.6/DCOracle/ociCurs.py", line 213, in _execute
> out=self._describe(self._ft)
> File "/usr/local/lib/python1.6/DCOracle/ociCurs.py", line 173, in _describe
> out.append(buf,dbsize,dbtype,ind,alen,arcode, f)
> TypeError: append requires exactly 1 argument; 7 given
<snip>
Aha! This is what you get for using a beta release <wink>. Apparently
Jim Fulton, who wrote DCoracle, was using the undocumented but
functional feature of append that allowed multiple arguments in releases
up to 1.5.2. This has been removed in 1.6. (forgive me if I got the
history/details wrong here)
To fix, you have two choices.
1. Use Python 1.5.2
2. change line 173 in _describe to:
out.append((buf,dbsize,dbtype,ind,alen,arcode, f))
This is, of course, untested, and there may be other
places where the code will fail for the same reason.
I say try it, and see what happens.
- Bill Scherer
More information about the Python-list
mailing list