diff --git a/src/smbclient/_os.py b/src/smbclient/_os.py index 998d4d3f..63d17741 100644 --- a/src/smbclient/_os.py +++ b/src/smbclient/_os.py @@ -1172,24 +1172,6 @@ def _set_basic_information( set_info(transaction, basic_info) -class LocalDirEntry: - """Mimics the structure of SMBDirEntry, but instead encapsulates a directory/file on a local filesystem""" - - def __init__(self, path) -> None: - self.path = path - - @property - def name(self): - """The entry's base filename, relative to the os.listdir() path argument.""" - return os.path.basename(self.path) - - def is_symlink(self): - return os.path.islink(self.path) - - def is_dir(self): - return os.path.isdir(self.path) - - class SMBDirEntry: def __init__(self, raw, dir_info, connection_cache=None): self._smb_raw = raw diff --git a/src/smbclient/shutil.py b/src/smbclient/shutil.py index e3363909..c9d7aefe 100644 --- a/src/smbclient/shutil.py +++ b/src/smbclient/shutil.py @@ -11,7 +11,7 @@ import sys from smbclient._io import SMBFileTransaction, SMBRawIO, query_info, set_info -from smbclient._os import LocalDirEntry, SMBDirEntry +from smbclient._os import SMBDirEntry from smbclient._os import copyfile as smbclient_copyfile from smbclient._os import ( is_remote_path, @@ -296,7 +296,7 @@ def copytree( if is_remote_path(src): dir_entries = list(scandir(src, **kwargs)) else: - dir_entries = [LocalDirEntry(os.path.join(src, result)) for result in os.listdir(src)] + dir_entries = list(os.scandir(src)) if is_remote_path(dst): makedirs(dst, exist_ok=dirs_exist_ok, **kwargs)