Share

ZPoPy Database Adaptor

Tracker: Bugs

5 FIX: global name "string" is not defined - ID: 458647
Last Update: Comment added ( nobody )

ZPoPy Version: 2.0.7

Zope Version: (Zope 2.4.0 (binary release, python 2.1, linux2-x86), python
2.1.1, linux2)

Python Version: 2.1.1 (#1, Aug 30 2001, 09:43:56) [GCC 2.95.3 20010315
(SuSE)]


in Function sql_quote__:
def sql_quote__(self, v, escapes={
'\\': '\\\\',
'\"': '\\\"',
'\'': '\\\'',
'\0': '\\0',
'\n': '\\n',
'\t': '\\t',
'\r': '\\r',
'\b': '\\n',
}):
find=string.find
^^^^^^^^^^^^

This causes Zope to exit with an error:
"global name "string" is not defined"
if you have some <dtml-sqlvar ... type="string"> in your
ZSQL-Method.

I added an "import string" in line 28, now it works (for me).


Nobody/Anonymous ( nobody ) - 2001-09-05 09:14

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )




Date: 2002-04-21 14:35
Sender: nobody

Logged In: NO

(comment for my comment error "PoPy.ProgrammingError:
ERROR: parser: parse error at or near "first")

Sorry, the mistake was in my query...

now all it's ok. no problem "string" anymore..


Date: 2002-04-21 14:25
Sender: nobody

Logged In: NO

i done the same and it works for me too, but now i've got
other error "PoPy.ProgrammingError: ERROR: parser: parse
error at or near "first"
(my query is right...)
it seems to come from "zpopyda/PoPy_db.py".

configuration :
Zope 2.5.0
Freebsd 4.5
python 2.1



Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.