Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'essentially': 0.04; 'debugging': 0.05; 'executed': 0.07; 'suppose': 0.07; 'valueerror:': 0.07; 'python': 0.09; "%s'": 0.09; 'bindings': 0.09; 'lost.': 0.09; 'name)': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:error': 0.11; 'fine.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'smtplib': 0.16; 'unsupported': 0.16; 'works...': 0.16; 'memory': 0.18; 'skip:" 40': 0.20; 'import': 0.21; 'libraries': 0.22; 'skip:_ 20': 0.22; 'raise': 0.24; 'command': 0.24; 'header :User-Agent:1': 0.26; 'supported': 0.26; '(most': 0.27; 'errors.': 0.27; 'found.': 0.27; 'library.': 0.27; 'header:X-Complaints- To:1': 0.28; 'run': 0.28; '>>>>': 0.29; 'hash': 0.29; 'loads': 0.29; 'thus,': 0.29; 'types.': 0.29; 'writes:': 0.29; 'file': 0.32; 'could': 0.32; 'skip:_ 30': 0.32; 'impression': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'eric': 0.35; 'smtp': 0.35; 'especially': 0.35; 'doing': 0.35; 'something': 0.35; 'received:org': 0.36; 'ability': 0.36; 'created': 0.36; 'charset:us-ascii': 0.36; 'problems': 0.36; 'operating': 0.36; 'bad': 0.37; 'does': 0.37; 'skip:v 20': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'login': 0.38; 'to:addr:python.org': 0.39; 'application': 0.40; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'real': 0.61; 'first': 0.61; 'received:217': 0.68; 'hoping': 0.72 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: error importing smtplib Date: Fri, 16 Nov 2012 20:38:13 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e09267.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:194cqrcu8l6VjTaGwgDN3Xlsscg= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353094707 news.xs4all.nl 6916 [2001:888:2000:d::a6]:38184 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33448 Eric Frederich 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 > 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.