jsphpl / enpass-to-keepass

Convert an Enpass csv export so it can be imported to a KeePass database using KeePassXC
51 stars 7 forks source link

issue with csv.reader #1

Open aadm opened 6 years ago

aadm commented 6 years ago

Thanks for the script and the thorough writeup on your blog. I wanted to use it to go back to Keepass after having tried Enpass for a while but it didn't work for me. This was the error:

Traceback (most recent call last):
  File "enpass-to-keepass.py", line 84, in <module>
    main(parser.parse_args())
  File "enpass-to-keepass.py", line 33, in main
    for row in reader:
_csv.Error: line contains NULL byte

I did a little digging on stackexchange and fixed the issue by by replacing this line (#29):

reader = csv.reader(args.input_file)

with this:

reader = csv.reader((line.replace('\0','') for line in args.input_file), delimiter=",")
jsphpl commented 6 years ago

Interesting, thanks for reporting @aadm! I will update the code as soon as i have time to test it.