Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33448 > unrolled thread

Re: error importing smtplib

Started byDieter Maurer <dieter@handshake.de>
First post2012-11-16 20:38 +0100
Last post2012-11-16 20:38 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: error importing smtplib Dieter Maurer <dieter@handshake.de> - 2012-11-16 20:38 +0100

#33448 — Re: error importing smtplib

FromDieter Maurer <dieter@handshake.de>
Date2012-11-16 20:38 +0100
SubjectRe: error importing smtplib
Message-ID<mailman.3757.1353094707.27098.python-list@python.org>
Eric Frederich <eric.frederich@gmail.com> writes:

> I created some bindings to a 3rd party library.
> I have found that when I run Python and import smtplib it works fine.
> If I first log into the 3rd party application using my bindings however I
> get a bunch of errors.
>
> What do you think this 3rd party login could be doing that would affect the
> ability to import smtp lib.
>
> Any suggestions for debugging this further.  I am lost.
>
> This works...
>
> import smtplib
> FOO_login()
>
> This doesn't...
>
> FOO_login()
> import smtplib
>
> Errors.....
>
>>>> import smtplib
> ERROR:root:code for hash sha224 was not found.
> Traceback (most recent call last):
>   File "/opt/foo/python27/lib/python2.7/hashlib.py", line 139, in <module>
>     globals()[__func_name] = __get_hash(__func_name)
>   File "/opt/foo/python27/lib/python2.7/hashlib.py", line 103, in
> __get_openssl_constructor
>     return __get_builtin_constructor(name)
>   File "/opt/foo/python27/lib/python2.7/hashlib.py", line 91, in
> __get_builtin_constructor
>     raise ValueError('unsupported hash type %s' % name)
> ValueError: unsupported hash type sha224

>From the error, I suppose it does something bad
for hash registries.

When I have analysed problems with "hashlib" (some time ago,
my memory may not be completely trustworthy), I got the
impression that "hashlib" essentially delegates to the
"openssl" libraries for the real work and especially
the supported hash types. Thus, I suspect that
your "FOO_login()" does something which confuses "openssl".
One potential reason could be that it loads a bad version
of an "openssl" shared library.

I would use the "trace" (shell) command to find out what operating system
calls are executed during "FOO_login()", hoping that one of them
give me a clue.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web