gpg: invalid armor: line longer than 20000 character

100 views
Skip to first unread message

Adam Williams

unread,
Apr 29, 2017, 4:51:51 AM4/29/17
to python-gnupg
I am signing a file with python-gnupg 0.4.0 on python 2.7.12

Subsequent attempt to verify the file has an "gpg: invalid armor: line longer than 20000 characters" error when checking with "gpg --verify testfile".  And I am unable to retrieve the contents of the file (via --output)

            sign = gpg.sign_file(
                rfile,
                keyid=sign_as,
                passphrase=passphrase,
            )
            wfile = open("testfile", "wb")
            wfile.write(sign.data)
            wfile.close()

Tried both with and without clearsign=True.  All files appear to end up with incorrect armor.

Vinay Sajip

unread,
Apr 29, 2017, 4:57:44 AM4/29/17
to python-gnupg
Dear Adam,

What version of GnuPG are you using? This doesn't look like a python-gnupg problem, as it doesn't control the actual generation of the signature. If all else fails, turn on logging, and see the commands that python-gnupg uses under the hood to invoke gpg. If you get the same failure calling those lines directly from a terminal prompt, then there might be some problem with your gpg installation. If it succeeds, then run the test file which comes with the source distribution (test_gnupg.py). If it fails, post the results.

Regards,

Vinay Sajip
Reply all
Reply to author
Forward
0 new messages