If anyone is familiar with python-gnupg, I am having some difficulty with the syntax.  I&#39;ve tried the following:<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "><div>
f = open(&#39;c:/test/filename.txt&#39;, &#39;r&#39;)</div><div>datae = gpg.encrypt_file(f.read(), &#39;<a href="mailto:ladymcse@gmail.com">ladymcse@gmail.com</a>&#39;, output=open(&#39;c:/gpg_test/data.gpg2&#39;, &#39;w&#39;))<br>
</div><div><br></div><div>or </div><div>file_to_encrypt = open(&#39;c:/gpg_test/data.gpg2&#39;, &#39;w&#39;)</div><div>datae = gpg(f.read(), &#39;<a href="mailto:ladymcse@gmail.com">ladymcse@gmail.com</a>&#39;, output=file_to_encrypt)</div>
<div><br></div><div>Either way, I can&#39;t get the output written to a file, it gives me an error:</div><div><br></div><div><div>Traceback (most recent call last):</div><div>  File &quot;&lt;pyshell#65&gt;&quot;, line 1, in &lt;module&gt;</div>
<div>    datae = gpg.encrypt_file(f.read(), &#39;<a href="mailto:beckymcq@google.com">beckymcq@google.com</a>&#39;, output=open(&#39;c:/test/data.gpg2&#39;, &#39;w&#39;))</div><div>  File &quot;C:\Python27\lib\site-packages\gnupg.py&quot;, line 583, in encrypt_file</div>
<div>    if os.path.exists(output):</div><div>  File &quot;C:\Python27\lib\genericpath.py&quot;, line 18, in exists</div><div>    os.stat(path)</div><div>TypeError: coercing to Unicode: need string or buffer, file found</div>
</div><div><br></div><div>Any thoughts?  Would reallly appreciate the help.</div><div><br></div><div>If you aren&#39;t familiar with this and know of resources, it would be awesome.  </div><div><br></div><div>Becky </div>
</span></div>