[mod_python] Problems w/ mod python

Victor Subervi victorsubervi at gmail.com
Thu Apr 17 15:22:04 EDT 2008


Hi:
I seem to have two problems related to mod python:
1) How do I import a file in the same folder as the script which is
importing? This does not work:

import x

2) I have the following code:

    try:
      cursor.execute(sql)
      print '¡Exito en introducir!<br />'
      print '<i>Esta página va a regresar a la página principal del carrito
de compras en 10 segundos.</i>'
    except IntegrityError:
      print 'Lo siento, pero el ID que entraste está usado actualmente por
otra entrada. Favor de dar para atráz y escojer otro número.'
    except OperationalError:
      print 'Lo siento, pero has añadido un carácter extraño a un número (o
en "ID", "precio", "recámaras" o "baños". Favor de dar para atráz y escojer
otro número.'
    except:
      print 'Lo siento, pero hay un error. Favor de dar para atráz y
averiguar donde está el error, y reintentar.'
When I enter and ID that is not a number, it should trigger the
IntegrityError. Instead, I get this in the error log:

[Thu Apr 17 12:06:37 2008] [error] [client 190.166.0.245] PythonHandler
mod_python.cgihandler: NameError: global name 'IntegrityError' is not
defined, referer: http://livestocksling.com/bre/iud.py
When I enter a non-digit in a float, I should get an OperationalError.
Instead, I get more garbage:

[Thu Apr 17 12:10:38 2008] [error] [client 190.166.0.245] PythonHandler
mod_python.cgihandler: NameError: global name 'OperationalError' is not
defined, referer: http://livestocksling.com/bre/iud.py
What do?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080417/082191d6/attachment.html


More information about the Mod_python mailing list