flika-org / flika

An interactive image processing program for biologists written in Python.
http://flika-org.github.io/
MIT License
22 stars 1 forks source link

Permission error saving plugins #24

Closed kyleellefsen closed 7 years ago

kyleellefsen commented 7 years ago

We need to change this code from plugin_manager.py:

        try:
            with open("install.zip", "wb") as output:
                output.write(data)

            with zipfile.ZipFile('install.zip', "r") as z:
                folder_name = os.path.dirname(z.namelist()[0])
                z.extractall(get_plugin_directory())

            os.remove("install.zip")

so that 'install.zip' is located outside of flika's directory and the user is guaranteed to have write permissions.

BrettJSettle commented 7 years ago

We can use tempfile and just store the zip in the temp directory.

kyleellefsen commented 7 years ago

Yeah sounds good.

BrettJSettle commented 7 years ago

switched to a tempfile, should be fixed