pylint: unspecified-encoding
authorgamesguru <mathmuncher11@gmail.com>
Tue, 29 Mar 2022 19:37:25 +0000 (15:37 -0400)
committergamesguru <mathmuncher11@gmail.com>
Tue, 29 Mar 2022 20:26:06 +0000 (16:26 -0400)
sql/__init__.py
sql/tables.sql

index f2568260d112824da59c25b8317e929f97ffa996..0c6c92e4c853ba69c428e0d82340e6db3628c4c5 100755 (executable)
@@ -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)
index fc90be97b990d452a9750ad4d187b73d905f39c0..668302dec412442d81729da7e374b7621371802d 100644 (file)
@@ -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),