From: gamesguru Date: Tue, 29 Mar 2022 19:37:25 +0000 (-0400) Subject: pylint: unspecified-encoding X-Git-Tag: 0.0.5~14 X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=bcc883f632a2d17e689a5b94c3569cf8e9f42ba5;p=nutratech%2Fnt-sqlite.git pylint: unspecified-encoding --- diff --git a/sql/__init__.py b/sql/__init__.py index f256826..0c6c92e 100755 --- a/sql/__init__.py +++ b/sql/__init__.py @@ -26,7 +26,7 @@ def build_ntsqlite(verbose=False): if verbose: print("\n-> Create tables") - with open("tables.sql") as tables: + with open("tables.sql", encoding="utf-8") as tables: cur.executescript(tables.read()) if verbose: @@ -38,7 +38,7 @@ def build_ntsqlite(verbose=False): file_path_full = os.path.join("data", file_path) # Loop over CSV files - with open(file_path_full) as csv_file: + with open(file_path_full, encoding="utf-8") as csv_file: reader = csv.DictReader(csv_file) values = ",".join("?" * len(reader.fieldnames)) reader = csv.reader(csv_file) diff --git a/sql/tables.sql b/sql/tables.sql index fc90be9..668302d 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -126,7 +126,7 @@ CREATE TABLE custom_foods ( CREATE TABLE cf_dat ( cf_id int NOT NULL, - nutr_id int NOT NULL, -- no FK constraing on usda :[ + nutr_id int NOT NULL, -- no FK constraining on usda :[ nutr_val real NOT NULL, notes text, PRIMARY KEY (cf_id, nutr_id),