From bc531441393dab7f98c9064a3187d583df675dd5 Mon Sep 17 00:00:00 2001 From: baffo Date: Thu, 1 Jun 2017 09:26:36 +0200 Subject: [PATCH] Fixes str() TypeError Fixes TypeError: str() takes at most 1 argument (2 given), change proposed by @jmathai related to https://github.com/jmathai/elodie/issues/223 --- send2trash/plat_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index ad0627f..bd167f9 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -133,7 +133,7 @@ def get_dev(path): def send2trash(path): if not isinstance(path, str): - path = str(path, sys.getfilesystemencoding()) + path = str(path).encode(sys.getfilesystemencoding()) if not op.exists(path): raise OSError("File not found: %s" % path) # ...should check whether the user has the necessary permissions to delete