Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: "url" ? Cannot import my csv file to Firefox #35

Closed
autoauto54 opened this issue Oct 7, 2019 · 5 comments
Closed

KeyError: "url" ? Cannot import my csv file to Firefox #35

autoauto54 opened this issue Oct 7, 2019 · 5 comments

Comments

@autoauto54
Copy link

autoauto54 commented Oct 7, 2019

Hey,
I've been trying for so long migrating from Safari to Firefox, that's how I found you, and this is amazing.

I've a CSV file which I successfully got from the mrc converter suite (script that opened and copied all my logins/passwords blablablabla)

Now that I've installed Python and ffpass, I'm getting this error when I try to import the file to Firefox

mbp-de-tom:~ autodrive$ ffpass import -f /Users/autodrive/Documents/pw/passwords\ copie\ 2.csv 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/ffpass", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 346, in main
    args.func(args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 289, in main_import
    logins = readCSV(args.from_file)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 188, in readCSV
    logins.append((rawURL(row["url"]), row["username"], row["password"]))
KeyError: 'url'
mbp-de-tom:~ autodrive$ 

I actually don't know what it means and how I could resolve this, so you can you help ? Thank you so much in advance! :)

here how my file looks in textedit
screen2

and in preview
screen

@autoauto54
Copy link
Author

after watching all the threads and trying to avoid every error I could get, I now get this simpler one but I still can't resolve it...

mbp-de-tom:~ autodrive$ ffpass import f- /Users/autodrive/Downloads/passwords.csv
usage: ffpass [-h] {export,import} ...
ffpass: error: unrecognized arguments: f- /Users/autodrive/Downloads/passwords.csv
mbp-de-tom:~ autodrive$

@jpaav
Copy link

jpaav commented Oct 16, 2019

Import does not raise this error for me as long as there is a column header named "url" in the csv, however when imported the "website" field in firefox's password manager is empty for all passwords.

@vallode
Copy link

vallode commented Oct 24, 2019

@autoauto54 looks to me like you need to fix your f- to -for --from
@jpaav I had a similar issue but around 20% of my passwords were affected, seems like some sort of format issue when it comes to how lockwise is recognising usable URLs

@Joppest
Copy link

Joppest commented Nov 1, 2019

I was able to solve this by omitting the header row from the csv file and changing the readCSV method to:

def readCSV(from_file):
    logins = []
    reader = csv.DictReader(lower_header(from_file), fieldnames=["url", "username", "password"]) 
    for row in reader:
        logins.append((rawURL(row["url"]), row["username"], row["password"]))
    return logins

@louisabraham
Copy link
Owner

Hi everyone,

As said in the documentation,

usage: ffpass import [-h] [-f FROM_FILE] [-d DIRECTORY] [-v]

imports a CSV with columns `url,username,password` (order insensitive)

If your headers are different, there is going to be an error. The error message should be more explicit though, it will be corrected in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants