[Yt-svn] commit/yt: MatthewTurk: Fixing a corner case where not all file systems report user permissions

Bitbucket commits-noreply at bitbucket.org
Wed Jun 8 07:25:29 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/1a7deeac4242/
changeset:   1a7deeac4242
branch:      yt
user:        MatthewTurk
date:        2011-06-08 16:25:04
summary:     Fixing a corner case where not all file systems report user permissions
correctly in advance.
affected #:  1 file (115 bytes)

--- a/yt/data_objects/hierarchy.py	Wed Jun 08 00:34:04 2011 -0400
+++ b/yt/data_objects/hierarchy.py	Wed Jun 08 07:25:04 2011 -0700
@@ -174,8 +174,12 @@
         self._barrier()
         if not writeable and not exists: return
         if writeable:
-            self._data_mode = 'a'
-            if not exists: self.__create_data_file(fn)
+            try:
+                if not exists: self.__create_data_file(fn)
+                self._data_mode = 'a'
+            except IOError:
+                self._data_mode = None
+                return
         else:
             self._data_mode = 'r'

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list