0

I keep getting a Unicode error while trying to access Keepass database with Python. I am trying the basic code from the git hub. Below is the output from the Command Prompt. I have tried db.encode and db.decode also.

C:\Python27>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32         bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from keepass import kpdb
>>> db = kpdb.Database('C:\\Python27\\k.kdb','test')
>>> print db
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\keepass\kpdb.py", line 154, in __str__
  ] ret += map(str,self.entries)
  File "C:\Python27\lib\site-packages\keepass\infoblock.py", line 80, in __str__
return '\n'.join(ret)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xbb in position 14: ordinal not in range(128)
user3753693
  • 225
  • 1
  • 5
  • 13
  • 1
    The `print` statement can cause problems when used with Unicode characters on Windows terminals. See [this answer](http://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console) for a workaround. – Selcuk Jul 10 '16 at 02:27
  • Thank you I will give that page a read – user3753693 Jul 10 '16 at 02:30

0 Answers0