Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#890 closed defect (fixed)

python plugin installer unzip fails

Reported by: browlingson Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: Python plugins and bindings Version: Trunk
Keywords: installer zip Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no


The plugin installer downloads python plugins as a zip file. The code in fails to unzip correctly if the top-level folder entry is not included in the zip.

It is possible to make a zip file with no top-level folder entry by doing:

zip ./foo/*

instead of:

zip -r ./foo

The code fails because it tries to create the directory hierarchy by looking for entries in the zip that end in '/'. If this isn't in the zip file then it then tries to extract a file to a non-existing directory, giving an error dialog that suggests (wrongly) it may be a permission problem.

Googling for python and unzip found the source of this code and some fixes in the comments.

There's a few 'try:except' clauses in the code that might be rewritten to return the exception so that a user gets more information when something fails.

Oh, and a line in that should maybe be: plugindir = os.path.join(os.path.normpath(str(QgsApplication?.qgisSettingsDirPath())), "python","plugins")

instead of concatenating path components.

Change History (2)

comment:1 Changed 13 years ago by gsherman

Resolution: fixed
Status: newclosed

comment:2 Changed 13 years ago by gsherman

Fixed at r7859

Note: See TracTickets for help on using tickets.