Commits

Jerónimo Albi  committed 886986c

Added public read/write permissions to temporary generated file

  • Participants
  • Parent commits 0ebbb29

Comments (0)

Files changed (2)

File CHANGELOG.rst

 ==================
 
  * Setup argument use_2to3 is now enabled only for python 3 series
+ * Added "Deployment notes" to README file
+ * Fixed minified file permissions bug
 
 1.1.0 - 2012-07-31
 ==================

File shrink/utils.py

 import logging
 import os
 import shutil
+import stat
 import tempfile
 
 from subprocess import PIPE
         LOG.debug('Deleted temporary file %s', tmp_file_name)
 
         return False
+    else:
+        # change read and write permissions on temp file
+        owner_rw = (stat.S_IRWXU & ~stat.S_IXUSR)
+        group_rw = (stat.S_IRWXG & ~stat.S_IXGRP)
+        others_rw = (stat.S_IRWXO & ~stat.S_IXOTH)
+        os.chmod(tmp_file_name, owner_rw | group_rw | others_rw)
 
     return tmp_file_name