Hello community, here is the log from the commit of package python-fs for openSUSE:Factory checked in at 2019-05-16 22:10:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-fs (Old) and /work/SRC/openSUSE:Factory/.python-fs.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-fs" Thu May 16 22:10:44 2019 rev:7 rq:703518 version:2.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-fs/python-fs.changes 2019-03-05 12:26:53.448835931 +0100 +++ /work/SRC/openSUSE:Factory/.python-fs.new.5148/python-fs.changes 2019-05-16 22:11:16.394219334 +0200 @@ -1,0 +2,11 @@ +Thu May 16 18:12:13 UTC 2019 - [email protected] + +Update to 2.4.5 +Fixes: +* Restored deprecated setfile method with deprecation warning + to change to writefile +* Fixed exception when a tarfile contains a path called '.' +* Made TarFS directory loading lazy + + +------------------------------------------------------------------- Old: ---- fs-2.4.4.tar.gz New: ---- fs-2.4.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-fs.spec ++++++ --- /var/tmp/diff_new_pack.YdYq5f/_old 2019-05-16 22:11:17.934218014 +0200 +++ /var/tmp/diff_new_pack.YdYq5f/_new 2019-05-16 22:11:17.962217990 +0200 @@ -13,13 +13,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-fs -Version: 2.4.4 +Version: 2.4.5 Release: 0 Summary: Python's filesystem abstraction layer License: MIT ++++++ fs-2.4.4.tar.gz -> fs-2.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/PKG-INFO new/fs-2.4.5/PKG-INFO --- old/fs-2.4.4/PKG-INFO 2019-02-23 11:15:03.000000000 +0100 +++ new/fs-2.4.5/PKG-INFO 2019-05-05 18:38:48.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: fs -Version: 2.4.4 +Version: 2.4.5 Summary: Python's filesystem abstraction layer Home-page: https://github.com/PyFilesystem/pyfilesystem2 Author: Will McGugan diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/fs/_version.py new/fs-2.4.5/fs/_version.py --- old/fs-2.4.4/fs/_version.py 2019-02-23 11:14:55.000000000 +0100 +++ new/fs-2.4.5/fs/_version.py 2019-05-05 18:01:01.000000000 +0200 @@ -1,3 +1,3 @@ """Version, used in module and setup.py. """ -__version__ = "2.4.4" +__version__ = "2.4.5" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/fs/base.py new/fs-2.4.5/fs/base.py --- old/fs-2.4.4/fs/base.py 2019-02-23 11:14:55.000000000 +0100 +++ new/fs-2.4.5/fs/base.py 2019-05-05 16:41:18.000000000 +0200 @@ -1356,6 +1356,8 @@ ) as dst_file: tools.copy_file_data(file, dst_file) + setfile = _new_name(writefile, "setfile") + def settimes(self, path, accessed=None, modified=None): # type: (Text, Optional[datetime], Optional[datetime]) -> None """Set the accessed and modified time on a resource. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/fs/osfs.py new/fs-2.4.5/fs/osfs.py --- old/fs-2.4.4/fs/osfs.py 2019-02-23 11:14:55.000000000 +0100 +++ new/fs-2.4.5/fs/osfs.py 2019-05-05 18:13:32.000000000 +0200 @@ -17,6 +17,7 @@ import shutil import stat import sys +import tempfile import typing import six @@ -134,7 +135,6 @@ raise errors.CreateFailed("root path does not exist") _meta = self._meta = { - "case_insensitive": os.path.normcase("Aa") == "aa", "network": False, "read_only": False, "supports_rename": True, @@ -143,6 +143,15 @@ "virtual": False, } + try: + # https://stackoverflow.com/questions/7870041/check-if-file-system-is-case-insensitive-in-python + # I don't know of a better way of detecting case insensitivity of a filesystem + with tempfile.NamedTemporaryFile(prefix="TmP") as _tmp_file: + _meta["case_insensitive"] = os.path.exists(_tmp_file.name.lower()) + except Exception: + if platform.system() != "Darwin": + _meta["case_insensitive"] = os.path.normcase("Aa") == "aa" + if _WINDOWS_PLATFORM: # pragma: no cover _meta["invalid_path_chars"] = ( "".join(six.unichr(n) for n in range(31)) + '\\:*?"<>|' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/fs/tarfs.py new/fs-2.4.5/fs/tarfs.py --- old/fs-2.4.4/fs/tarfs.py 2019-01-06 13:13:51.000000000 +0100 +++ new/fs-2.4.5/fs/tarfs.py 2019-05-05 18:01:01.000000000 +0200 @@ -20,7 +20,7 @@ from .info import Info from .iotools import RawWrapper from .opener import open_fs -from .path import dirname, relpath, basename, isbase, parts, frombase +from .path import dirname, relpath, basename, isbase, normpath, parts, frombase from .wrapfs import WrapFS from .permissions import Permissions @@ -272,9 +272,18 @@ else: self._tar = tarfile.open(fileobj=file, mode="r") - self._directory = OrderedDict( - (relpath(self._decode(info.name)).rstrip("/"), info) for info in self._tar - ) + self._directory_cache = None + + @property + def _directory(self): + """Lazy directory cache.""" + if self._directory_cache is None: + _decode = self._decode + _directory = ((_decode(info.name).strip("/"), info) for info in self._tar) + self._directory_cache = OrderedDict( + (name, info) for name, info in _directory if normpath(name) + ) + return self._directory_cache def __repr__(self): # type: () -> Text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/fs.egg-info/PKG-INFO new/fs-2.4.5/fs.egg-info/PKG-INFO --- old/fs-2.4.4/fs.egg-info/PKG-INFO 2019-02-23 11:15:03.000000000 +0100 +++ new/fs-2.4.5/fs.egg-info/PKG-INFO 2019-05-05 18:38:48.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: fs -Version: 2.4.4 +Version: 2.4.5 Summary: Python's filesystem abstraction layer Home-page: https://github.com/PyFilesystem/pyfilesystem2 Author: Will McGugan diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fs-2.4.4/tests/test_tarfs.py new/fs-2.4.5/tests/test_tarfs.py --- old/fs-2.4.4/tests/test_tarfs.py 2019-02-23 10:58:23.000000000 +0100 +++ new/fs-2.4.5/tests/test_tarfs.py 2019-05-05 18:01:01.000000000 +0200 @@ -188,6 +188,30 @@ self.assertTrue(top.get("tar", "is_file")) +class TestBrokenDir(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.tmpfs = open_fs("temp://tarfstest") + + @classmethod + def tearDownClass(cls): + cls.tmpfs.close() + + def setUp(self): + self.tempfile = self.tmpfs.open("test.tar", "wb+") + with tarfile.open(mode="w", fileobj=self.tempfile) as tf: + tf.addfile(tarfile.TarInfo("."), io.StringIO) + self.tempfile.seek(0) + self.fs = tarfs.TarFS(self.tempfile) + + def tearDown(self): + self.fs.close() + self.tempfile.close() + + def test_listdir(self): + self.assertEqual(self.fs.listdir("/"), []) + + class TestImplicitDirectories(unittest.TestCase): """Regression tests for #160. """
