From 8f9f687ed8544bc6e202b89f1a3e3a47307acf9e Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Thu, 18 Jun 2020 19:27:06 +0100 Subject: [PATCH] Remove isinstance() from fileutil.path_safe() paths are derived from urls which are strings. --- linkcheck/fileutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkcheck/fileutil.py b/linkcheck/fileutil.py index 5c8c8948..cc39342d 100644 --- a/linkcheck/fileutil.py +++ b/linkcheck/fileutil.py @@ -70,7 +70,7 @@ else: def path_safe(path): """Ensure path string is compatible with the platform file system encoding.""" - if isinstance(path, str) and not os.path.supports_unicode_filenames: + if path and not os.path.supports_unicode_filenames: path = path.encode(FSCODING, "replace").decode(FSCODING) return path