summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index be313d104..63fffffbc 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -922,6 +922,11 @@ def _read(fname, *, delimiter=',', comment='#', quote='"',
comments = None
else:
# assume comments are a sequence of strings
+ if "" in comment:
+ raise ValueError(
+ "comments cannot be an empty string. Use comments=None to "
+ "disable comments."
+ )
comments = tuple(comment)
comment = None
if len(comments) == 0: