From 106f7d5b3442e17b6c9614c7e091aa5edec1e369 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Aug 2013 13:48:12 +0530 Subject: [PATCH] Ensure no comments in the apsw dump cause problems --- src/apsw_shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apsw_shell.py b/src/apsw_shell.py index 61f78c45e6..d8215e65b3 100644 --- a/src/apsw_shell.py +++ b/src/apsw_shell.py @@ -1088,6 +1088,8 @@ Enter SQL statements terminated with a ";" self.write(self.stdout, "\n") def comment(s): + if isinstance(s, bytes): + s = s.decode('utf-8', 'replace') self.write(self.stdout, textwrap.fill(s, 78, initial_indent="-- ", subsequent_indent="-- ")+"\n") pats=", ".join([(x,"(All)")[x=="%"] for x in cmd])