File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232def read_csv_rows (filepath : str ) -> Iterator [List [str ]]:
3333 """Yield rows from a CSV file, skipping the header."""
34- with open (filepath , "r" ) as csvfile :
34+ with open (filepath , "r" , newline = "" ) as csvfile :
3535 reader = csv .reader (csvfile )
3636 next (reader , None ) # Skip header
3737 for row in reader :
@@ -74,7 +74,7 @@ def checkFilesInSoundsNotInCSV() -> int:
7474 referenced_files = set ()
7575 for f in csv_directory .glob ("*.csv" ):
7676 for row in read_csv_rows (str (f )):
77- if len (row ) = = 6 :
77+ if len (row ) > = 6 :
7878 fname = row [5 ].strip ()
7979 if fname :
8080 referenced_files .add (fname )
@@ -133,7 +133,6 @@ def checkFilenameLengthsInCSV() -> int:
133133 if f .name .endswith ("_scripts.csv" ):
134134 continue
135135 for row in read_csv_rows (str (f )):
136- row = [field .strip ().strip ('"' ) for field in row ]
137136 if len (row ) == 6 :
138137 filename_in_csv = row [5 ].strip ()
139138 if len (Path (filename_in_csv ).stem ) > 8 :
@@ -315,4 +314,4 @@ def checkSequentialStringIDs() -> int:
315314 if error_count > 0 :
316315 sys .exit (EX_DATAERR )
317316 else :
318- sys .exit (EX_OK )
317+ sys .exit (EX_OK )
You can’t perform that action at this time.
0 commit comments