From 9bba75d533217b3f961b3d435579cbc852b1287f Mon Sep 17 00:00:00 2001 From: Chris Brinker Date: Thu, 6 Sep 2018 13:15:02 -0700 Subject: [PATCH] Fix for super() usage on "old style class" ZipFile (#546) I was experienceing an error of "TypeError: must be type, not classobj" on the line using `super()._extract_member()` below. This error appears to be due to the `zipfile.ZipFile` class never inheriting from `object` which is a requirement since py2.2 (2001). Since the use of `super()` in `PermPreservingZipFile()` depends on `object` being somewhere in the inheritance tree, I am including it in the class definition of `PermPreservingZipFile()`. My testing of this patch locally has proven to solve the "TypeError" I was seeing. --- pex/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pex/common.py b/pex/common.py index a0e06deb7..2b322cb85 100644 --- a/pex/common.py +++ b/pex/common.py @@ -78,7 +78,7 @@ def teardown(self): _MKDTEMP_SINGLETON = MktempTeardownRegistry() -class PermPreservingZipFile(zipfile.ZipFile): +class PermPreservingZipFile(zipfile.ZipFile, object): """A ZipFile that works around https://bugs.python.org/issue15795""" def _extract_member(self, member, targetpath, pwd):