Skip to content

safe-fs Python: virtual device stat omits uid/gid and fails native os.stat #777

Closed

Description

@kamilio

With Safe Bash / Safe FS 0.1.684, the custom JSPI Pyodide executor fails native os.stat('/dev/null'):

OSError: [Errno 61] canonical identity or required stat metadata unavailable: '/dev/null'

Reproduced in workerd/Miniflare against an injected authoritative filesystem. Normal native file stat and null descriptor I/O work.

DeviceFileSystem supplies synthetic ino, dev, nlink, size and times for /dev/null and /dev, but omits uid/gid. Python's stat projection requires both and rejects the result. Please provide complete stable virtual-device metadata for path stat/lstat and descriptor fstat, keeping virtual-device identity separate from backing filesystem identity. Add actual native Python tests for os.stat, os.lstat, and os.fstat(os.open('/dev/null', ...)) and /dev metadata.

This is separate from closed #756, which fixed descriptor open/read/write.

Activity

  1. kamilio commented on Sep 18, 2026

    @kamilio
    MemberAuthor

    Validated against current main: DeviceFileSystem virtual stat metadata still omits uid/gid. Assigned a dedicated home-owned worktree worker for a focused TDD fix, including path/descriptor metadata and native Python acceptance. Delivery will be direct to main with release monitoring.

  2. kamilio commented on Sep 18, 2026

    @kamilio
    MemberAuthor

    Fix verified on remote main at 6f7e182. Virtual /dev/null and /dev now provide uid/gid without weakening Python validation or merging backing identity. TDD: five metadata regressions and actual Pyodide/workerd errno61 reproduced before fix. GREEN: 157 focused tests, maintained Safe FS typecheck, actual native Python stat/lstat/fstat across all access modes and directory/stability/identity assertions. Parent scoped maintained ESLint policy clean on all changed code/test files. Release publication is monitored separately; no newly published version is claimed yet.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions