[PEAK] 2 code problems
Alain Poirier
alain.poirier at net-ng.com
Tue Apr 26 20:17:08 EDT 2005
Hi,
I found 2 little problems :
o With my version of the ldap module, `peak test` enter an infinite
loop at `peak.storage.LDAP.__iter__` , because
`peak.storage.LDAP.RES_SEARCH_RESULT` is evaluated to 101 in
`peak.storage.LDAP`. But the test `LDAPSchemaTest` is using
the 'RES_SEARCH_RESULT' value.
I fixed it with :
> cvs diff peak/storage/tests/LDAP.py
Index: peak/storage/tests/LDAP.py
===================================================================
RCS file: /cvsroot/PEAK/src/peak/storage/tests/LDAP.py,v
retrieving revision 1.5
diff -r1.5 LDAP.py
7c7
< from peak.storage.LDAP import LDAPCursor, LDAPConnection
---
> from peak.storage.LDAP import LDAPCursor, LDAPConnection,
RES_SEARCH_RESULT
32c32
< return 'RES_SEARCH_RESULT', [
---
> return RES_SEARCH_RESULT, [
o Using Python 2.4 and the sqlite module 0.5.1, the `bulletins post ...`
commande of the examples is failing with :
...
File "/usr/lib/python2.4/site-packages/peak/storage/SQL.py", line 106,
in execute
return self._cursor.execute(*args)
File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 258, in
execute
self.rs = self.con.db.execute(SQL % parms)
TypeError: int argument required
Because the boolean values are converted into the strings 'False' /
'True' instead of 0 / 1
So, I did :
> cvs diff bulletins/storage.py
Index: bulletins/storage.py
===================================================================
RCS file: /cvsroot/PEAK/examples/bulletins/src/bulletins/storage.py,v
retrieving revision 1.5
diff -r1.5 storage.py
114c114
< str(ob.editedOn), ob.hidden)
---
> str(ob.editedOn), int(ob.hidden))
o Note : with Python 2.4, we got the warning "DeprecationWarning: the
whrandom module is deprecated; please use the random module"
Regards,
--
Alain POIRIER,
Directeur technique
_______________________________________________________________________
Net-ng
Immeuble Germanium
80 av. des Buttes de Coesmes Web : http://www.net-ng.com
35700 RENNES Email: alain.poirier at net-ng.com
FRANCE
______________________________________________________________________
Ce message et tout document joint sont confidentiels. Toute diffusion
ou publication en est interdite. Si vous recevez ce message par erreur,
merci d'en avertir immédiatement l'expéditeur par email et de supprimer
ce message et tout document joint.
More information about the PEAK
mailing list