Browse Source

makewheel: properly chmod libraries that have no write permissions

Seems to be necessary on macOS for install_name_tool to be able to work on some libraries.  Not sure why fchmod/fstat isn't working right.
rdb 7 years ago
parent
commit
c0138930c9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      makepanda/makewheel.py

+ 1 - 1
makepanda/makewheel.py

@@ -371,8 +371,8 @@ class WheelFile(object):
                 # Otherwise, just copy it over.
                 # Otherwise, just copy it over.
                 temp.write(open(source_path, 'rb').read())
                 temp.write(open(source_path, 'rb').read())
 
 
-            os.fchmod(temp.fileno(), os.fstat(temp.fileno()).st_mode | 0o111)
             temp.close()
             temp.close()
+            os.chmod(temp.name, os.stat(temp.name).st_mode | 0o711)
 
 
             # Now add dependencies.  On macOS, fix @loader_path references.
             # Now add dependencies.  On macOS, fix @loader_path references.
             if sys.platform == "darwin":
             if sys.platform == "darwin":