UnicodeDecodeError when using encrypt_file

25 views
Skip to first unread message

François Delpierre

unread,
Nov 24, 2012, 1:33:34 PM11/24/12
to python...@googlegroups.com
  File "/usr/local/lib/python2.7/dist-packages/python_gnupg-0.3.1-py2.7.egg/gnupg.py", line 981, in encrypt_file
    self._handle_io(args, file, result, passphrase=passphrase, binary=True)
  File "/usr/local/lib/python2.7/dist-packages/python_gnupg-0.3.1-py2.7.egg/gnupg.py", line 637, in _handle_io
    p = self._open_subprocess(args, passphrase is not None)
  File "/usr/local/lib/python2.7/dist-packages/python_gnupg-0.3.1-py2.7.egg/gnupg.py", line 552, in _open_subprocess
    cmd = ' '.join(self.make_args(args, passphrase))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 148: ordinal not in range(128)

François Delpierre

unread,
Nov 25, 2012, 5:53:17 AM11/25/12
to python...@googlegroups.com
I Fixed it by using the decode('utf-8') on the output file name string.
Reply all
Reply to author
Forward
0 new messages