Fix for bad open on tarfile
svn: r14306
This commit is contained in:
parent
458c42b0d4
commit
8abe461bb9
@ -532,9 +532,14 @@ class PluginStatus(ManagedWindow.ManagedWindow):
|
|||||||
if path.endswith(".zip") or path.endswith(".ZIP"):
|
if path.endswith(".zip") or path.endswith(".ZIP"):
|
||||||
file_obj = Zipfile(buffer)
|
file_obj = Zipfile(buffer)
|
||||||
elif path.endswith(".tar.gz") or path.endswith(".tgz"):
|
elif path.endswith(".tar.gz") or path.endswith(".tgz"):
|
||||||
|
try:
|
||||||
file_obj = tarfile.open(None, fileobj=buffer)
|
file_obj = tarfile.open(None, fileobj=buffer)
|
||||||
|
except:
|
||||||
|
callback(_("Error: cannot open '%s'") % path)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
return [("Error: unknown file type: '%s'") % path]
|
callback(_("Error: unknown file type: '%s'") % path)
|
||||||
|
return
|
||||||
# First, see what versions we have/are getting:
|
# First, see what versions we have/are getting:
|
||||||
good_gpr = set()
|
good_gpr = set()
|
||||||
for gpr_file in [name for name in file_obj.getnames() if name.endswith(".gpr.py")]:
|
for gpr_file in [name for name in file_obj.getnames() if name.endswith(".gpr.py")]:
|
||||||
|
Loading…
Reference in New Issue
Block a user