diff options
author | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-12-27 16:50:20 +0000 |
---|---|---|
committer | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-12-27 16:50:20 +0000 |
commit | 3b900b1c11d9b5fc247b9fdf6461bceea47e7950 (patch) | |
tree | 5c43bc973942a1c49f65a9d9a5edf468354753dc /fs/osfs/__init__.py | |
parent | 754fcc98df0d379a92c7b9741505c257e09a532f (diff) | |
download | pyfilesystem-git-3b900b1c11d9b5fc247b9fdf6461bceea47e7950.tar.gz |
Python3 compatibility
Diffstat (limited to 'fs/osfs/__init__.py')
-rw-r--r-- | fs/osfs/__init__.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/osfs/__init__.py b/fs/osfs/__init__.py index 10d9e5b..013b64e 100644 --- a/fs/osfs/__init__.py +++ b/fs/osfs/__init__.py @@ -31,7 +31,7 @@ from fs.osfs.watch import OSFSWatchMixin @convert_os_errors def _os_stat(path): - """Replacement for os.stat that raises FSError subclasses.""" + """Replacement for os.stat that raises FSError subclasses.""" return os.stat(path) @convert_os_errors @@ -204,8 +204,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS): return super(OSFS, self).getmeta(meta_name, default) @convert_os_errors - def open(self, path, mode="r", **kwargs): - #mode = filter(lambda c: c in "rwabt+",mode) + def open(self, path, mode="r", **kwargs): mode = ''.join(c for c in mode if c in 'rwabt+') sys_path = self.getsyspath(path) try: @@ -331,7 +330,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS): @convert_os_errors def getinfo(self, path): stats = self._stat(path) - info = dict((k, getattr(stats, k)) for k in dir(stats) if not k.startswith('__') ) + info = dict((k, getattr(stats, k)) for k in dir(stats) if k.startswith('st_')) info['size'] = info['st_size'] # TODO: this doesn't actually mean 'creation time' on unix ct = info.get('st_ctime', None) |