[python-nl] wincertstore
Geert Stappers
stappers at stappers.nl
Tue Jul 25 04:36:43 EDT 2017
On Tue, Jul 25, 2017 at 09:58:35AM +0200, Wichert Akkerman wrote:
> On 25 Jul 2017, at 09:45, Geert Stappers wrote:
> >>>> for storename in ("CA", "ROOT"):
> > with wincertstore.CertSystemStore(storename) as store:
> > for cert in store.itercerts(usage=wincertstore.SERVER_AUTH):
> > print(cert.get_pem().decode("ascii"))
> > print(cert.get_name())
> > print(cert.enhanced_keyusage_names())
> >
> >
> > Traceback (most recent call last):
> > File "<pyshell#15>", line 4, in <module>
> > print(cert.get_pem().decode("ascii"))
> > AttributeError: 'str' object has no attribute 'decode'
> >>>>
> >
> > Nu zie ik niet wat ik fout doe.
> > Wat is de fout?
> >
> > Kan het zijn dat ik Python 3.6 gebruik en wincertstore 0.2 Python 3.3 verwacht?
>
> Nee, het voorbeeld is voor Python 2. In Python 3 heeft een
> string geen encode en decode functies. Ik gok dat je het
> ???.decode(???ascii???)??? stukje gewoon kan weglaten.
Yes, leaving the 'decode("ascii")' out got me beyond the AttributeError.
@Christian: Where should I go to get https://pypi.python.org/pypi/wincertstore
updated information.
Groeten
Geert Stappers
--
Leven en laten leven
More information about the Python-nl
mailing list