From 43482418bc4507f8ec27ef112b918c3d5060344d Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 24 May 2016 14:41:55 +0300 Subject: [PATCH] Actually, isinstance needs to check unicode too --- rarfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rarfile.py b/rarfile.py index f386729..50d3409 100644 --- a/rarfile.py +++ b/rarfile.py @@ -759,7 +759,7 @@ class RarFile(object): self._fd = fd id = fd.read(len(RAR_ID)) if id != RAR_ID: - if isinstance(self.rarfile, str): + if isinstance(self.rarfile, (str, unicode)): raise NotRarFile("Not a Rar archive: {}".format(self.rarfile)) raise NonRarFile("Not a Rar archive") -- 2.11.4.GIT