Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!newsfeed.tele2net.at!news.panservice.it!feed.xsnews.nl!border02.ams.xsnews.nl!feeder04.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F09-14.ams.news.kpn.nl From: Cecil Westerhof Newsgroups: comp.lang.python Subject: Re: Looks like Python 3 files do not confirm to Python 3 Organization: Decebal Computing References: <87mw1orex3.fsf@Equus.decebal.nl> X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E X-Homepage: http://www.decebal.nl/ Date: Fri, 01 May 2015 09:16:30 +0200 Message-ID: <87ioccrcmp.fsf@Equus.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sCE9M7a3REcnonmi4bivOifEFtg= MIME-Version: 1.0 Content-Type: text/plain Lines: 49 NNTP-Posting-Host: 81.207.62.244 X-Trace: 1430465332 news.kpn.nl 25014 81.207.62.244@kpn/81.207.62.244:43693 Xref: csiph.com comp.lang.python:89706 Op Friday 1 May 2015 08:27 CEST schreef Cecil Westerhof: > On my system in: > /usr/lib/python3.4/site-packages/ndg/httpsclient/ssl_peer_verification.py > > it says: > try: > from ndg.httpsclient.subj_alt_name import SubjectAltName > from pyasn1.codec.der import decoder as der_decoder > SUBJ_ALT_NAME_SUPPORT = True > except ImportError, e: > SUBJ_ALT_NAME_SUPPORT = False > SUBJ_ALT_NAME_SUPPORT_MSG = ( > 'SubjectAltName support is disabled - check pyasn1 package ' > 'installation to enable' > ) > import warnings > warnings.warn(SUBJ_ALT_NAME_SUPPORT_MSG) > > which gives: File > "/usr/lib/python3.4/site-packages/ndg/httpsclient/ssl_peer_verification.py", > line 17 except ImportError, e: It is solved by making it: except (ImportError) as e: The same for: /usr/lib/python3.4/site-packages/ndg/httpsclient/subj_alt_name.py I would not mind to solve those and others if I could contribute them to the Python community. What is the procedure for that? > > Does my system have outdated files, or are there still Python 3 > files that do not conform to Python 3? > > The only real python program I use at the moment uses: > import urllib3.contrib.pyopenssl > > and then you get this error. > > > So another reason to stay with Python 2. (While still writing code > that works in Python3.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof