core (memory/memory): use str for path in getFiles and setFile to allow use of Path instances

This commit is contained in:
Goffi 2020-09-17 16:34:22 +02:00
commit a82f7108a2

View file

@ -1468,7 +1468,7 @@ class Memory(object):
@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 @@ class Memory(object):
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 @@ class Memory(object):
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