Skip to content

Commit 96d8828

Browse files
committed
Detect CPORT header in SAS files
1 parent 2e29e11 commit 96d8828

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/io/sas/sas_xport.py

+2
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def _read_header(self):
279279
# read file header
280280
line1 = self._get_row()
281281
if line1 != _correct_line1:
282+
if "**COMPRESSED**" in _correct_line1:
283+
raise ValueError("This appears to be a CPORT file.")
282284
raise ValueError("Header record is not an XPORT file.")
283285

284286
line2 = self._get_row()

0 commit comments

Comments
 (0)