Skip to content

Invalid file error on reading a sas7bdat file created by vers7, win 95 #340

Description

@stefanverbeeck

Describe the issue
We are getting exceptions when trying to load the following file sas7bdat file:
dummy_file.zip

Exception:

data_frame, metadata = parser_entry_point(
                           ^^^^^^^^^^^^^^^^^^^
  File "pyreadstat/_readstat_parser.pyx", line 1411, in pyreadstat._readstat_parser.parser_entry_point
    data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly,
  File "pyreadstat/_readstat_parser.pyx", line 1354, in pyreadstat._readstat_parser.run_conversion
    run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj)
  File "pyreadstat/_readstat_parser.pyx", line 1009, in pyreadstat._readstat_parser.run_readstat_parser
    check_exit_status(error)
  File "pyreadstat/_readstat_parser.pyx", line 913, in pyreadstat._readstat_parser.check_exit_status
    raise ReadstatError(err_message)
pyreadstat._readstat_parser.ReadstatError: Invalid file, or file has unsupported features

We don't know why this one specifically fails.
It is noted, that the header lists this as being made by SAS version 7; on windows 95 32 bit.
(The actual file is generated by new procedures, it's just an old file that new data is being append too).

Image

To Reproduce

import pyreadstat as ps
path = "dummy_file.sas7bdat"
df, meta = ps.read_sas7bdat(path)

Setup Information:
tried on various pyreadstat versions;
All installed via pip; running on windows 11 64bit, running on plain python 3.12 in a virtualenv.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrequires changes in Readstatwaiting for changes in the C library Readstat

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions