Skip to content

SAS XPORT (.xpt) and SPSS portable (.por) files are not loadable through FileIO #32

Description

@davidanthoff

Found while auditing the ReadStat stack (see #31).

Two formats ReadStat can read are not reachable from load():

.por is half-wired. IteratorInterfaceExtensions.getiterator dispatches on the extension and calls read_por for .por (src/StatFiles.jl:58-59), but FileIO's registry only registers format"Stata" (.dta), format"SPSS" (.sav, magic $FL2) and format"SAS" (.sas7bdat) against StatFiles. There is no format or fileio_load method for .por, so load("x.por") never reaches the branch that would handle it. The .por branch is only reachable by constructing a StatFile directly.

.xpt is not wired at all. ReadStat has exported read_xport since v1.1.0 and has a types.xpt fixture, but StatFiles has no format registration, no fileio_load method, and no getiterator branch for it.

Fixing either means adding a format to FileIO's central registry (FileIO/src/registry.jl) as well as a fileio_load method here, so it needs an upstream FileIO PR alongside the StatFiles change. Note SPSS portable files are text-based with a 200-byte header, so the magic-byte approach used for .sav may not transfer directly.

Also worth noting: test/types.por is already checked in but no test exercises it.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions