diff --git a/CHANGELOG.md b/CHANGELOG.md index 267c942b..28d6cb18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -338,7 +338,7 @@ Please update your code accordingly. ### Fixed -- Root dir of MemoryFS accesible as a file +- Root dir of MemoryFS accessible as a file - Packaging issues @televi - Deprecation warning re collections.Mapping diff --git a/docs/source/guide.rst b/docs/source/guide.rst index 2c54655c..fc3ecdee 100644 --- a/docs/source/guide.rst +++ b/docs/source/guide.rst @@ -85,7 +85,7 @@ This can be a useful debugging aid! Closing ~~~~~~~ -FS objects have a :meth:`~fs.base.FS.close` methd which will perform any required clean-up actions. For many filesystems (notably :class:`~fs.osfs.OSFS`), the ``close`` method does very little. Other filesystems may only finalize files or release resources once ``close()`` is called. +FS objects have a :meth:`~fs.base.FS.close` method which will perform any required clean-up actions. For many filesystems (notably :class:`~fs.osfs.OSFS`), the ``close`` method does very little. Other filesystems may only finalize files or release resources once ``close()`` is called. You can call ``close`` explicitly once you are finished using a filesystem. For example:: diff --git a/docs/source/info.rst b/docs/source/info.rst index ba0d6d12..82c3e076 100644 --- a/docs/source/info.rst +++ b/docs/source/info.rst @@ -46,7 +46,7 @@ file:: resource_info = fs.getinfo('myfile.txt', namespaces=['details', 'access']) -In addition to the specified namespaces, the fileystem will also return +In addition to the specified namespaces, the filesystem will also return the ``basic`` namespace, which contains the name of the resource, and a flag which indicates if the resource is a directory. diff --git a/fs/base.py b/fs/base.py index 07a16756..879cc544 100644 --- a/fs/base.py +++ b/fs/base.py @@ -156,7 +156,7 @@ def getinfo(self, path, namespaces=None): Arguments: path (str): A path to a resource on the filesystem. namespaces (list, optional): Info namespaces to query. The - `"basic"` namespace is alway included in the returned + `"basic"` namespace is always included in the returned info, whatever the value of `namespaces` may be. Returns: @@ -834,7 +834,7 @@ def getsyspath(self, path): def getospath(self, path): # type: (Text) -> bytes - """Get the *system path* to a resource, in the OS' prefered encoding. + """Get the *system path* to a resource, in the OS' preferred encoding. Arguments: path (str): A path on the filesystem. @@ -846,7 +846,7 @@ def getospath(self, path): fs.errors.NoSysPath: If there is no corresponding system path. This method takes the output of `~getsyspath` and encodes it to - the filesystem's prefered encoding. In Python3 this step is + the filesystem's preferred encoding. In Python3 this step is not required, as the `os` module will do it automatically. In Python2.7, the encoding step is required to support filenames on the filesystem that don't encode correctly. @@ -1544,11 +1544,11 @@ def touch(self, path): def validatepath(self, path): # type: (Text) -> Text - """Validate a path, returning a normalized absolute path on sucess. + """Validate a path, returning a normalized absolute path on success. Many filesystems have restrictions on the format of paths they support. This method will check that ``path`` is valid on the - underlaying storage mechanism and throw a + underlying storage mechanism and throw a `~fs.errors.InvalidPath` exception if it is not. Arguments: diff --git a/fs/errors.py b/fs/errors.py index 400bac76..8b8d2705 100644 --- a/fs/errors.py +++ b/fs/errors.py @@ -170,7 +170,7 @@ def __reduce__(self): class InvalidPath(PathError): - """Path can't be mapped on to the underlaying filesystem.""" + """Path can't be mapped on to the underlying filesystem.""" default_message = "path '{path}' is invalid on this filesystem " diff --git a/fs/info.py b/fs/info.py index 21bb1498..05914f3c 100644 --- a/fs/info.py +++ b/fs/info.py @@ -1,4 +1,4 @@ -"""Container for filesystem resource informations. +"""Container for filesystem resource information. """ from __future__ import absolute_import, print_function, unicode_literals diff --git a/fs/tempfs.py b/fs/tempfs.py index 3f32c8c6..3faeb99e 100644 --- a/fs/tempfs.py +++ b/fs/tempfs.py @@ -1,6 +1,6 @@ """Manage filesystems in temporary locations. -A temporary filesytem is stored in a location defined by your OS +A temporary filesystem is stored in a location defined by your OS (``/tmp`` on linux). The contents are deleted when the filesystem is closed. diff --git a/fs/test.py b/fs/test.py index 232666da..0201b735 100644 --- a/fs/test.py +++ b/fs/test.py @@ -499,7 +499,7 @@ def test_getinfo(self): except (TypeError, ValueError): raise AssertionError("info should be JSON serializable") - # Non existant namespace is not an error + # Non existent namespace is not an error no_info = self.fs.getinfo("foo", "__nosuchnamespace__").raw self.assertIsInstance(no_info, dict) self.assertEqual(no_info["basic"], {"name": "foo", "is_dir": False}) @@ -629,7 +629,7 @@ def test_move(self): self.fs.move("foo2", "bar", overwrite=True) self.assert_not_exists("foo2") - # Check moving to a non-existant directory + # Check moving to a non-existent directory with self.assertRaises(errors.ResourceNotFound): self.fs.move("bar", "egg/bar") diff --git a/tests/test_tree.py b/tests/test_tree.py index 28f20577..ac0bb748 100644 --- a/tests/test_tree.py +++ b/tests/test_tree.py @@ -58,7 +58,7 @@ def test_error(self): def broken_filterdir(path, **kwargs): if path.startswith("/deep/deep1/"): - # Because error messages differ accross Python versions + # Because error messages differ across Python versions raise Exception("integer division or modulo by zero") return filterdir(path, **kwargs)