Parcourir la source

[2937] Parse CSV in strict mode

Don't accept invalid inputs. It seems some versions of the csv library
rejected this before, but some didn't. Making sure all of them reject
now, to get more reliable operation and consistent behavior.
Michal 'vorner' Vaner il y a 12 ans
Parent
commit
4bc06a779c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/bin/usermgr/b10-cmdctl-usermgr.py.in

+ 1 - 1
src/bin/usermgr/b10-cmdctl-usermgr.py.in

@@ -75,7 +75,7 @@ class UserManager:
             # Just let any file read error bubble up; it will
             # be caught in the run() method
             with open(self.options.output_file, newline='') as csvfile:
-                reader = csv.reader(csvfile)
+                reader = csv.reader(csvfile, strict=True)
                 for row in reader:
                     self.user_info[row[0]] = row