From 50ac7ac29bc879e58a12eb63bfc9c8e22e14b636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Tue, 16 Feb 2021 10:20:03 +0545 Subject: [PATCH] fix PathLike typehints --- .pylintrc | 1 + src/webdav4/client.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index 0c9a726..7150552 100644 --- a/.pylintrc +++ b/.pylintrc @@ -143,6 +143,7 @@ disable=print-statement, cyclic-import, fixme, design, + ungrouped-imports, # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/src/webdav4/client.py b/src/webdav4/client.py index bb25c38..0233271 100644 --- a/src/webdav4/client.py +++ b/src/webdav4/client.py @@ -5,11 +5,9 @@ import shutil from contextlib import contextmanager, suppress from io import TextIOWrapper, UnsupportedOperation -from os import PathLike from typing import ( TYPE_CHECKING, Any, - AnyStr, BinaryIO, Callable, Dict, @@ -38,11 +36,12 @@ if TYPE_CHECKING: from datetime import datetime + from os import PathLike + from typing import AnyStr from .multistatus import DAVProperties, MultiStatusResponse from .types import AuthTypes, HeaderTypes, HTTPResponse, URLTypes - logger = logging.getLogger(__name__) @@ -544,7 +543,7 @@ def download_fileobj( def download_file( self, from_path: str, - to_path: PathLike[AnyStr], + to_path: "PathLike[AnyStr]", callback: Callable[[int], Any] = None, ) -> None: """Download file from remote path to local path.""" @@ -553,7 +552,7 @@ def download_file( def upload_file( self, - from_path: PathLike[AnyStr], + from_path: "PathLike[AnyStr]", to_path: str, overwrite: bool = False, callback: Callable[[int], Any] = None,