--nl now ignores blank lines, closes #376

This commit is contained in:
Simon Willison 2022-01-09 20:12:39 -08:00
commit d2a79d200f
2 changed files with 2 additions and 2 deletions

View file

@ -791,7 +791,7 @@ def insert_upsert_implementation(
else:
try:
if nl:
docs = (json.loads(line) for line in decoded)
docs = (json.loads(line) for line in decoded if line.strip())
else:
docs = json.load(decoded)
if isinstance(docs, dict):