Browse Source

Fix Python 3.2 compatibility issue with noatime open().

Closes #164.
Jonas Borgström 10 years ago
parent
commit
b5a9085717
2 changed files with 12 additions and 0 deletions
  1. 6 0
      CHANGES
  2. 6 0
      attic/archive.py

+ 6 - 0
CHANGES

@@ -3,6 +3,12 @@ Attic Changelog
 
 
 Here you can see the full list of changes between each Attic release.
 Here you can see the full list of changes between each Attic release.
 
 
+Version 0.15
+------------
+
+(feature release, released on X)
+- Fix Python 3.2 compatibility issue with noatime open() (#164)
+
 Version 0.14
 Version 0.14
 ------------
 ------------
 
 

+ 6 - 0
attic/archive.py

@@ -31,6 +31,12 @@ has_mtime_ns = sys.version >= '3.3'
 has_lchmod = hasattr(os, 'lchmod')
 has_lchmod = hasattr(os, 'lchmod')
 has_lchflags = hasattr(os, 'lchflags')
 has_lchflags = hasattr(os, 'lchflags')
 
 
+# Python <= 3.2 raises OSError instead of PermissionError (See #164)
+try:
+    PermissionError = PermissionError
+except NameError:
+    PermissionError = OSError
+
 
 
 class DownloadPipeline:
 class DownloadPipeline: