GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stdlib: RunFile fails to resolve absolute script paths · Issue #259 · go-python/gpython

stdlib: RunFile fails to resolve absolute script paths #259

New issue
Copy link
New issue
Copy link
Open
#261
Open
stdlib: RunFile fails to resolve absolute script paths#259
#261
Copy link

Description

@ac1982
ac1982
opened on Oct 11, 2026
Issue body actions

On current main (444ae5e), py.RunFile cannot resolve an absolute filename with the default compile options. resolveRunPath joins every input to an entry in the search path before checking whether the result is absolute; joining the default "." with "/tmp/script.py" drops the leading slash.

Reproduction on Linux/arm64, Go 1.27.1:

ctx := py.NewContext(py.DefaultContextOpts())
defer ctx.Close()
// Create /tmp/script.py containing: value = 42
_, err := py.RunFile(ctx, "/tmp/script.py", py.CompileOpts{}, nil)

Actual: FileNotFoundError despite the file existing. Passing "script.py" with CompileOpts{CurDir: "/tmp"} works.

Expected: the absolute path is tried directly, independently of the current directory and sys.path, as the resolver's comment describes. This also matters when embedding gpython and supplying paths obtained from a file picker or filepath.Abs.

I am preparing a focused fix and regression tests. AI coding assistance is being used for reproduction, implementation, and validation.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.