Skip to content

Commit 33c6b81

Browse files
committed
splitreports: handle empty string chunk_size
Handle bot parameter `chunk_size` values empty string, due to missing parameter typing checks
1 parent c7f9f8b commit 33c6b81

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
1717

1818
### Core
1919
- Drop support for Python 3.8 (fixes #2616, PR#2617 by Sebastian Wagner).
20+
- `intelmq.lib.splitreports`: Handle bot parameter `chunk_size` values empty string, due to missing parameter typing checks (PR#2604 by Sebastian Wagner).
2021

2122
### Development
2223

intelmq/lib/splitreports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def generate_reports(report_template: Report, infile: BinaryIO, chunk_size: Opti
151151
Yields:
152152
report: a Report object holding the chunk in the raw field
153153
"""
154-
if chunk_size is None:
154+
if not chunk_size: # None, empty string or False
155155
report = report_template.copy()
156156
data = infile.read()
157157
if data:

0 commit comments

Comments
 (0)