Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!newsfeed.pionier.net.pl!feed.xsnews.nl!border03.ams.xsnews.nl!feeder03.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F10-19.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> <55432496$0$12994$c3e8da3$5496439d@news.astraweb.com> 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:36:04 +0200 Message-ID: <87a8xorbq3.fsf@Equus.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:FCtJgGJG70SumpmXfq696Ao+IpY= MIME-Version: 1.0 Content-Type: text/plain Lines: 52 NNTP-Posting-Host: 81.207.62.244 X-Trace: 1430466290 news.kpn.nl 21100 81.207.62.244@kpn/81.207.62.244:43851 Xref: csiph.com comp.lang.python:89708 Op Friday 1 May 2015 09:00 CEST schreef Steven D'Aprano: > On Fri, 1 May 2015 04:27 pm, Cecil Westerhof wrote: > >> On my system in: >> /usr/lib/python3.4/site-packages/ndg/httpsclient/ssl_peer_verification.py > > ndg is a third-party package, not part of the Python 3 standard > library. Oops, barking up to the wrong tree. Sorry. >> 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: > [...] >> which gives: File >> "/usr/lib/python3.4/site-packages/ndg/httpsclient/ssl_peer_verification.py", >> line 17 except ImportError, e: > > I think you're missing the last line of the error. I'm guessing it > was probably NameError: name 'e' is not defined. Nope: except ImportError, e: ^ SyntaxError: invalid syntax It is solved by: except (ImportError) as e: But then: PARSER_RE_STR = '/(%s)=' % '|'.join(DN_LUT.keys() + DN_LUT.values()) TypeError: unsupported operand type(s) for +: 'dict_keys' and 'dict_values' >> Does my system have outdated files, or are there still Python 3 >> files that do not conform to Python 3? > > I would say, either you have accidentally installed a Python 2 file > in your Python 3 library, or it is simply a bug in ndg. I will contact the ndg people. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof