Skip to content

Commit 5b43e1b

Browse files
committed
Detect CPORT header in SAS files
1 parent 2e29e11 commit 5b43e1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/io/sas/sas_xport.py

+4
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ def _read_header(self):
279279
# read file header
280280
line1 = self._get_row()
281281
if line1 != _correct_line1:
282+
if "**COMPRESSED**" in line1:
283+
raise ValueError(
284+
"Header record indicates a CPORT file, which is not readable."
285+
)
282286
raise ValueError("Header record is not an XPORT file.")
283287

284288
line2 = self._get_row()

0 commit comments

Comments
 (0)