soxoj / maigret

🕵️‍♂️ Collect a dossier on a person by username from thousands of sites
https://t.me/osint_maigret_bot
MIT License
10.26k stars 794 forks source link

Attempt to write into Python distribution folders #678

Open ArneBachmann opened 2 years ago

ArneBachmann commented 2 years ago

After a successful run of maigret with many matches I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/maigret", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.10/dist-packages/maigret/maigret.py", line 723, in run
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/dist-packages/maigret/maigret.py", line 717, in main
    db.save_to_file(db_file)
  File "/usr/local/lib/python3.10/dist-packages/maigret/sites.py", line 304, in save_to_file
    with open(filename, "w") as f:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/maigret/resources/data.json'

Obviously maigret should not attempt to write into a Python-internal folder.

soxoj commented 2 years ago

Thanks, it is known bug, we were going to use home folder for saving local updates of the Maigret DB.

fen0s commented 2 years ago

it's working as intended right now (DB is located inside maigret package, and maigret package is located inside python libs), but i'll move the DB to home folder when i get a bit more free time, thanks for mentioning this detail to us