maigret icon indicating copy to clipboard operation
maigret copied to clipboard

Attempt to write into Python distribution folders

Open ArneBachmann opened this issue 3 years ago • 2 comments

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.

ArneBachmann avatar Oct 03 '22 16:10 ArneBachmann

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

soxoj avatar Oct 03 '22 20:10 soxoj

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

fen0s avatar Oct 03 '22 20:10 fen0s