From f4b52e8cddccbc3f88b2907959b0d0d9113027c9 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Mon, 12 Sep 2005 02:23:17 +0000 Subject: [PATCH] Mingw and ZPsycopgDA fixes. --- ChangeLog | 5 +++++ ZPsycopgDA/db.py | 3 +-- psycopg/cursor_type.c | 2 +- setup.cfg | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ca32437..9472ed98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-09-12 Federico Di Gregorio + + * ZpsycopgDA/db.py: fixed problem with OperationalError that resulted in + cryptic message to Zope users ("'OperationalError' is not defined".) + 2005-08-23 Federico Di Gregorio * setup.py: applied patch from Daniele Varrazzo to avoid segfaults diff --git a/ZPsycopgDA/db.py b/ZPsycopgDA/db.py index b727f2fe..69a3435c 100644 --- a/ZPsycopgDA/db.py +++ b/ZPsycopgDA/db.py @@ -29,7 +29,6 @@ import psycopg2 from psycopg2.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN, DATE from psycopg2 import NUMBER, STRING, ROWID, DATETIME - # the DB object, managing all the real query work @@ -175,7 +174,7 @@ class DB(TM, dbi_db.DB): c.execute(qs, query_data) else: c.execute(qs) - except OperationalError, e: + except psycopg2.OperationalError, e: try: self.close() except: diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 22201704..9b0b97df 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -963,7 +963,7 @@ psyco_curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs) char *table_name; char *sep = "\t", *null = NULL; long int bufsize = DEFAULT_COPYSIZE; - PyObject *file, *res = NULL; + PyObject *file, *columns, *res = NULL; static char *kwlist[] = {"file", "table", "sep", "null", "size", NULL}; diff --git a/setup.cfg b/setup.cfg index b385d07f..f703e752 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,9 +9,9 @@ use_pydatetime=1 # include_dirs is the preferred method for locating postgresql headers, # but some extra checks on sys.platform will still be done in setup.py. # the next line is the default as used on psycopg author Debian system: -include_dirs=.:/usr/include/postgresql/8.0:/usr/include/postgresql/8.0/server +include_dirs=.:/usr/include/postgresql:/usr/include/postgresql/8.0 # uncomment next line on Mandrake 10.x (and comment previous one): -#include_dirs=.:/usr/include/pgsql:/usr/include/pgsql/server +#include_dirs=.:/usr/include/pgsql/8.0:/usr/include/pgsql/8.0/server # if postgresql is installed somewhere weird (i.e., not in your runtime library # path like /usr/lib), just add the right path in "library_dir" any extra