File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,11 @@ jobs:
113113 try:
114114 with z.open(rname) as rf:
115115 txt = io.TextIOWrapper(rf, encoding='utf-8', errors='replace')
116- routes = list(csv.DictReader(txt))
116+ reader = csv.DictReader(txt)
117+ # Remove BOM from header names if present
118+ if reader.fieldnames:
119+ reader.fieldnames = [fn.lstrip('\ufeff') for fn in reader.fieldnames]
120+ routes = list(reader)
117121 except Exception as e:
118122 msg = f'Failed to read routes.txt for {aid}: {e}'
119123 print('ERROR -', msg)
@@ -218,7 +222,11 @@ jobs:
218222 try:
219223 with z.open(rname) as rf:
220224 txt = io.TextIOWrapper(rf, encoding='utf-8', errors='replace')
221- routes = list(csv.DictReader(txt))
225+ reader = csv.DictReader(txt)
226+ # Remove BOM from header names if present
227+ if reader.fieldnames:
228+ reader.fieldnames = [fn.lstrip('\ufeff') for fn in reader.fieldnames]
229+ routes = list(reader)
222230 except Exception as e:
223231 msg = f'Failed to read routes.txt for {agency}: {e}'
224232 print(f'Agency {agency}: ERROR - {msg}')
You can’t perform that action at this time.
0 commit comments