From 8902befd7c83af84e9f68d7abea19edc6b14dca4 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Fri, 11 May 2018 12:22:37 +0200 Subject: [PATCH] Convert from bytes to strings --- datasette_pytables/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datasette_pytables/__init__.py b/datasette_pytables/__init__.py index d44c9f9..5e37c45 100644 --- a/datasette_pytables/__init__.py +++ b/datasette_pytables/__init__.py @@ -80,7 +80,10 @@ class Connection: row[field] = table_row.nrow elif field == '*': for col in table.colnames: - row[col] = table_row[col] + value = table_row[col] + if type(value) is bytes: + value = value.decode('utf-8') + row[col] = value else: row[field] = table_row[field] rows.append(row) -- 2.39.5