Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78718 > unrolled thread
| Started by | Martin Manns <mmanns@gmx.net> |
|---|---|
| First post | 2014-10-05 17:56 +0200 |
| Last post | 2014-10-05 17:56 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
Python gnupg verification issue Martin Manns <mmanns@gmx.net> - 2014-10-05 17:56 +0200
| From | Martin Manns <mmanns@gmx.net> |
|---|---|
| Date | 2014-10-05 17:56 +0200 |
| Subject | Python gnupg verification issue |
| Message-ID | <20141005175633.1c76127f@Fuddel> |
[Multipart message — attachments visible in raw view] — view raw
Hi
I have trouble with gnupg when verifying files with whitespace in the
filename using detached signatures.
Example:
I have two identical files "Hello_World.txt" and "Hello World.txt"
along with two externally generated signature files
"Hello_World.txt.sig" and "Hello World.txt.sig" (see attachments).
When verifying on the command line everything goes well:
----------
mn@Fuddel:~/tmp$ gpg --verify Hello\ World.txt.sig
gpg: Signature made Sun 05 Oct 2014 04:57:25 PM CEST using DSA key ID
AE2EB31C gpg: Good signature from "xxx"
mn@Fuddel:~/tmp$ gpg --verify Hello_World.txt.sig
gpg: Signature made Sun 05 Oct 2014 04:57:13 PM CEST using DSA key ID
AE2EB31C gpg: Good signature from "xxx"
----------
However, when using Python, the first file fails:
----------
>>> import os, gnupg
>>> hp = os.path.expanduser("~")+"/.gnupg"
>>> gpg = gnupg.GPG(gnupghome=hp)
>>> with open("Hello World.txt.sig", "rb") as sigfile:
... verified = gpg.verify_file(sigfile, "Hello World.txt")
...
>>> verified.valid
False
>>> with open("Hello_World.txt.sig", "rb") as sigfile:
... verified = gpg.verify_file(sigfile, "Hello_World.txt")
...
>>> verified.valid
True
----------
Should I use gnupg verification in a different way?
Should I file a bug report?
My system:
Debian unstable 32 bit
Python 2.7.8
gnupg 0.3.6
Regards
Martin
Back to top | Article view | comp.lang.python
csiph-web