Sorry, only saw your first response, didn't see the others.<div><br></div><div>I compiled Python 2.7.2 myself with --enable-shared</div><div>To create standalone applications that interact with this 3rd party program your main C file instead of having a "main" function has a FOO_user_main function.</div>
<div>When you link your program you link against a provided foo_main.o file.<br><br></div><div>My python executable (called FOO_user_main) was created from python.c but with main replaced with FOO_user_main.... no other differences.</div>
<div><br></div><div>I have been using this type of installation for a couple of years and everything works fine.</div><div><br></div><div>I only get these errors/warnings on one environment out of 10 or so development and qa machines.</div>
<div><br></div><div>Any help trying to figure out what is different before and after the login would be appreciated.</div><div>Is there some place in /proc I could look to see what happened?</div><div><br></div><div>Thanks,</div>
<div>~Eric</div><div><br></div><div><div><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 11:57 AM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11/15/2012 9:38 AM, Eric Frederich wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I created some bindings to a 3rd party library.<br>
I have found that when I run Python and import smtplib it works fine.<br>
If I first log into the 3rd party application using my bindings however<br>
I get a bunch of errors.<br>
<br>
What do you think this 3rd party login could be doing that would affect<br>
the ability to import smtp lib.<br>
</blockquote>
<br></div>
I don't know what 'login' actually means,...<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This works...<br>
<br>
import smtplib<br>
FOO_login()<br>
<br>
This doesn't...<br>
<br>
FOO_login()<br>
import smtplib<br>
</blockquote>
<br></div>
but my first guess is that FOO_login alters the module search path so that at least one of smtplib, hashlib, or the _xxx modules imported by hashlib is being imported from a different place. To check that<br>
<br>
import sys<br>
before = sys.path<br>
FOO_login()<br>
print sys.path==before<br>
<br>
Similar code can check anything else accessible through sys.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Errors.....<br>
<br>
>>> import smtplib<br>
ERROR:root:code for hash sha224 was not found.<br>
</blockquote>
<br></div>
I am puzzled by this line before the traceback. I cannot find 'ERROR' in either smtplib or hashlib.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Traceback (most recent call last):<br>
File "/opt/foo/python27/lib/<u></u>python2.7/hashlib.py", line 139, in <module><br>
globals()[__func_name] = __get_hash(__func_name)<br>
File "/opt/foo/python27/lib/<u></u>python2.7/hashlib.py", line 103, in<br>
__get_openssl_constructor<br>
return __get_builtin_constructor(<u></u>name)<br>
File "/opt/foo/python27/lib/<u></u>python2.7/hashlib.py", line 91, in<br>
__get_builtin_constructor<br>
raise ValueError('unsupported hash type %s' % name)<br>
ValueError: unsupported hash type sha224<br>
</blockquote></div>
[snip similar messages]<br>
<br>
It is also unusual to get multiple tracebacks. *Exactly* how are you running python and is 2.7 what you intend to run?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Terry Jan Reedy<br>
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div></div>