Re: [Zope] psycopg import error
Hi, 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: to: 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. Cheers, Tom -- Thomas O'Connor Web developer (02) 498 54130 Thomas.OConnor@newcastle.edu.au Office of IT Services Bar on the Hill Building UoN Services Limited University Drive Callaghan NSW 2308
Hey, I finally reverted all the changes and fixed it like you said editing the DA.py in ZPsycoDA. thought i let you know about it. through this if psycopg2.__version__[:6] not in ALLOWED_PSYCOPG_VERSIONS: and then if psycopg2.__version__.split(' ')[0] not in ALLOWED_PSYCOPG_VERSIONS: ps: in changelog it shows that changes have been done by the author on 2009-05-19. but doesn't say which version. Thanks Amir Tlc2 On Wed, Jul 1, 2009 at 8:51 PM, Thomas OConnor < Thomas.OConnor@newcastle.edu.au> wrote:
Hi,
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:
to: 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.
Cheers,
Tom
-- Thomas O'Connor Web developer
(02) 498 54130 Thomas.OConnor@newcastle.edu.au
Office of IT Services Bar on the Hill Building UoN Services Limited University Drive Callaghan NSW 2308 _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Amir -
Thomas OConnor