[Python-de] Python3 - pathlib - python-gnupg Problem
Maurice Kemmann
muckisg at googlemail.com
Di Feb 6 03:23:06 EST 2018
Hallo,
ich nutze pathlib um OS unabhängige Scripte zu schreiben. Im Moment spiele ich ein wenig mit python-gnupg herrum und laufe in folgendes Problem:
<code>
import gnupg
from pathlib import Path
from pprint import pprint
gpg = gnupg.GPG(gnupghome=Path("/home/mucki/.gnupg/"))
<\code>
Das führt zu folgenden Fehler unter Linux:
>> python3 gpg-test.py
Traceback (most recent call last):
File "gpg-test.py", line 5, in <module>
gpg = gnupg.GPG(gnupghome=Path("/home/mucki/.gnupg/"))
File "/usr/local/lib/python3.6/site-packages/gnupg.py", line 755, in __init__
p = self._open_subprocess(["--version"])
File "/usr/local/lib/python3.6/site-packages/gnupg.py", line 832, in _open_subprocess
logger.debug("%s: %s", result.pid, debug_print(cmd))
File "/usr/lib64/python3.6/subprocess.py", line 461, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'PosixPath' is not iterable
Unter Windows 10 gibt es eine passende Fehlermeldung mit "type WindowsPath not iterable".
Es scheint ja mit dem subprocess module zusammenzuhängen, aber hier hört mein Wissen leider auf. Kann mir jemand helfen? Liegt der Fehler bei mir? Wenn ja, warum?
Danke,
Maurice
Mehr Informationen über die Mailingliste python-de