Use repr when reporting htmlfile names as they can have ansi control codes

This commit is contained in:
Kovid Goyal 2021-04-05 22:18:40 +05:30
parent a031f07214
commit 09f3dd67b0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)