Skip to content

Commit 27c0213

Browse files
committed
slightly restrict zip generation
Signed-off-by: John Seekins <john@robot-house.us>
1 parent c135509 commit 27c0213

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ice_scrapers/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ def repair_zip(zip_code: int, locality: str) -> Tuple[str, bool]:
224224
"""
225225
zcode = str(zip_code)
226226
cleaned = False
227-
if len(zcode) < 5:
227+
# don't replace an empty zip with all 0s
228+
if 0 < len(zcode) < 5:
228229
# pad any prefix
229230
zeros = "0" * (5 - len(zcode))
230231
zcode = f"{zeros}{zcode}"

0 commit comments

Comments
 (0)