# HG changeset patch # User Goffi # Date 1600353262 -7200 # Node ID b14e95f7034f34eeb414894e641bb98c165fc99e # Parent 40794e658d6821cfaefedfdb2f54da4e8af13a49 core (memory/memory): use `str` for `path` in `getFiles` and `setFile` to allow use of `Path` instances diff -r 40794e658d68 -r b14e95f7034f sat/memory/memory.py --- a/sat/memory/memory.py Thu Sep 17 11:27:57 2020 +0200 +++ b/sat/memory/memory.py Thu Sep 17 16:34:22 2020 +0200 @@ -1468,7 +1468,7 @@ @param parent(unicode, None): id of the directory containing the files None to ignore empty string to look for root files/directories - @param path(unicode, None): path to the directory containing the files + @param path(Path, unicode, None): path to the directory containing the files @param type_(unicode, None): type of file filter, can be one of C.FILE_TYPE_* @param file_hash(unicode, None): hash of the file to retrieve @param hash_algo(unicode, None): algorithm use for file_hash @@ -1499,6 +1499,7 @@ if owner is not None: owner = owner.userhostJID() if path is not None: + path = str(path) # permission are checked by _getParentDir parent, remaining_path_elts = yield self._getParentDir( client, path, parent, namespace, owner, peer_jid, perms_to_check @@ -1630,6 +1631,7 @@ owner = owner.userhostJID() if path is not None: + path = str(path) # _getParentDir will check permissions if peer_jid is set, so we use owner parent, remaining_path_elts = yield self._getParentDir( client, path, parent, namespace, owner, owner, perms_to_check