Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33394 > unrolled thread
| Started by | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| First post | 2012-11-15 11:57 -0500 |
| Last post | 2012-11-15 11:57 -0500 |
| 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.
Re: error importing smtplib Terry Reedy <tjreedy@udel.edu> - 2012-11-15 11:57 -0500
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2012-11-15 11:57 -0500 |
| Subject | Re: error importing smtplib |
| Message-ID | <mailman.3719.1352998657.27098.python-list@python.org> |
On 11/15/2012 9:38 AM, Eric Frederich wrote:
> Hello,
>
> 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.
I don't know what 'login' actually means,...
> This works...
>
> import smtplib
> FOO_login()
>
> This doesn't...
>
> FOO_login()
> import smtplib
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
import sys
before = sys.path
FOO_login()
print sys.path==before
Similar code can check anything else accessible through sys.
> Errors.....
>
> >>> import smtplib
> ERROR:root:code for hash sha224 was not found.
I am puzzled by this line before the traceback. I cannot find 'ERROR' in
either smtplib or hashlib.
> 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
[snip similar messages]
It is also unusual to get multiple tracebacks. *Exactly* how are you
running python and is 2.7 what you intend to run?
--
Terry Jan Reedy
Back to top | Article view | comp.lang.python
csiph-web