I've been running M2Crypto successfully using Python 2.4 on Windows 2000,
and now I'm trying to get it to work on Python 2.3.4 on Linux.
Attempting to initialize a context results in
Traceback (most recent call last):
File "/www/htdocs/sitetruth.com/cgi/ratingdetails.c gi", line 46, in ?
DetailsPageBuil der.detailspage (kdbfile,ktempl atefile,url) # check and
display domain or URL as web page
File "./sitetruth/DetailsPageBuil der.py", line 70, in detailspage
sitecert = InfoSSL2.Certif icate(siteinfo, kverifylocation s, verbose)
File "./sitetruth/InfoSSL2.py", line 147, in __init__
self.ctx = createsslcontex t(trustedcafile , verbose) # Generate general SSL
context
File "./sitetruth/InfoSSL2.py", line 40, in createsslcontex t
ctx = SSL.Context('ss lv3') # Create context with SSL params
File "/home/sitetruth/lib/python/M2Crypto/SSL/Context.py", line 43, in __init__
map()[long(self.ctx)] = self
ValueError: invalid literal for long(): _480e1008_p_SSL _CTX
which, when I look at the code and try some test cases, seems
legitimate. The cacheing code is trying to convert a reference to an
object (a C object, in fact) into a "long". Python 2.4 on Windows
will do that. Python 2.3.4 on Linux converts it to a string first,
gets "_480e1008_p_SS L_CTX", and then tries to convert that to an
integer, which fails.
M2Crypto is supposed to work with Python 2.3, so this should work.
John Nagle
and now I'm trying to get it to work on Python 2.3.4 on Linux.
Attempting to initialize a context results in
Traceback (most recent call last):
File "/www/htdocs/sitetruth.com/cgi/ratingdetails.c gi", line 46, in ?
DetailsPageBuil der.detailspage (kdbfile,ktempl atefile,url) # check and
display domain or URL as web page
File "./sitetruth/DetailsPageBuil der.py", line 70, in detailspage
sitecert = InfoSSL2.Certif icate(siteinfo, kverifylocation s, verbose)
File "./sitetruth/InfoSSL2.py", line 147, in __init__
self.ctx = createsslcontex t(trustedcafile , verbose) # Generate general SSL
context
File "./sitetruth/InfoSSL2.py", line 40, in createsslcontex t
ctx = SSL.Context('ss lv3') # Create context with SSL params
File "/home/sitetruth/lib/python/M2Crypto/SSL/Context.py", line 43, in __init__
map()[long(self.ctx)] = self
ValueError: invalid literal for long(): _480e1008_p_SSL _CTX
which, when I look at the code and try some test cases, seems
legitimate. The cacheing code is trying to convert a reference to an
object (a C object, in fact) into a "long". Python 2.4 on Windows
will do that. Python 2.3.4 on Linux converts it to a string first,
gets "_480e1008_p_SS L_CTX", and then tries to convert that to an
integer, which fails.
M2Crypto is supposed to work with Python 2.3, so this should work.
John Nagle
Comment