From 09f3dd67b04027a7f4d04b34345976fc8231530c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 5 Apr 2021 22:18:40 +0530 Subject: [PATCH] Use repr when reporting htmlfile names as they can have ansi control codes --- src/calibre/ebooks/html/input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 73c2cf2c1e..6e172ef188 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -152,7 +152,7 @@ class HTMLFile(object): return hash(self.path) def __str__(self): - return 'HTMLFile:%d:%s:%s'%(self.level, 'b' if self.is_binary else 'a', self.path) + return 'HTMLFile:%d:%s:%r'%(self.level, 'b' if self.is_binary else 'a', self.path) def __repr__(self): return unicode_type(self)