Skip to content

Commit

Permalink
Ensure file exists before attempting chmod.
Browse files Browse the repository at this point in the history
  • Loading branch information
davebx committed Aug 3, 2015
1 parent 8d12ff2 commit 7401aa0
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -84,7 +84,7 @@ def extract( self, path ):
external_attributes = self.archive.getinfo( filename ).external_attr
# The 2 least significant bytes are irrelevant, the next two contain unix permissions.
unix_permissions = external_attributes >> 16
if unix_permissions != 0:
if unix_permissions != 0 and os.path.exists( absolute_filepath ):
os.chmod( absolute_filepath, unix_permissions )
return os.path.abspath( extraction_path )

Expand Down

0 comments on commit 7401aa0

Please sign in to comment.