I also experienced the problem this morning when trying to use the product 
ZPsycopgDA version 2.0.11 on Zope.  The error reported by Plone/Zope is:

Error Value: psycopg version mismatch (imported 2.0.11 (dt dec ext pq3))

Due to the fact it is extracting the first 5 characters (2.0.1) and comparing 
it to the full version (2.0.11), thus failing.

Instead of changing the index to 6 (which would then break 2.0.8 versions, 
etc.), you can explode the string by spaces, then extract the first part:

so the only change would be to line 119 of DA.py, from:
        if psycopg2.__version__[:5] not in ALLOWED_PSYCOPG_VERSIONS:

        if psycopg2.__version__.split(' ')[0] not in ALLOWED_PSYCOPG_VERSIONS:

No other changes to the versions definition would be required.

This will be both backwards and forwards compatible with all versions from 
0.0.0 to 999.999.999 (well, infinity really)!

Keep up the good work.



Thomas O'Connor
Web developer

(02) 498 54130

Office of IT Services
Bar on the Hill Building
UoN Services Limited
University Drive
Callaghan NSW 2308
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to