Skip to content

Drop the claim that gemdb file.py leaves the script's directory off sys.path - #129

Merged
jgfoster merged 1 commit into
mainfrom
mfernandez/syspath-doc-fixes
Oct 14, 2026
Merged

jgfoster merged 1 commit into
mainfrom
mfernandez/syspath-doc-fixes

Conversation

@MatiasFernandez

@MatiasFernandez MatiasFernandez commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

What

Removes the claim, in the README ("One thing differs from python3…") and in docs/grail.md, that gemdb file.py does not put the script's directory on sys.path, so a script cannot import a file next to it. The limitation no longer exists, so this PR deletes both mentions and adds nothing to replace them.

Where the claim came from

Why it no longer holds

  • Grail #847 was closed as completed on 2026-09-07. The closing comment says it was fixed on Grail main by 8c8f503e ("Populate sys.path at startup…", 2026-08-29), which adds importlib class >> ___installScriptDir___:.
  • That comment also mentioned a remaining gap: the directory was added as a relative path. Grail #854 ("Make sys.path[0] absolute, and give -m the working directory") fixed it and was merged the same day.
  • vendor-pins.sh pins Grail beef473, and both 8c8f503e and #854's merge commit 203b481 are its ancestors (checked with the GitHub compare API).
  • GemTalk/brain-freeze already dropped the claim (3ffee35, ef5cf1e). Its tools/seed.py now says "gemdb tools/seed.py puts this directory on sys.path".

How it was tested

I ran the installed gemdb (GemDB Python (beef473, engine 4.0.0.a4)) on macOS arm64 against this layout:

app/helper.py   VALUE = 42
app/later.py    VALUE = 7
app/main.py
import os, sys
print("sys.path[0]:", sys.path[0])
import helper
print("helper.VALUE =", helper.VALUE)
os.chdir("/")
import later
print("after chdir, later.VALUE =", later.VALUE)
Invocation sys.path[0] sibling import import after os.chdir("/") exit
gemdb app/main.py (relative path, from the parent dir) absolute …/app 42 7 0
cd / && gemdb /abs/app/main.py absolute …/app 42 7 0
python3 app/main.py (reference) absolute …/app 42 7 —

The output was identical to python3's in every case.

README line 148 ("your own .py files can be imported once their directory is on sys.path") is still accurate and isn't changed.

🤖 Generated with Claude Code

…ys.path

Grail #847 is fixed in the pinned Grail, so the limitation the README
and docs/grail.md describe no longer exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MatiasFernandez
MatiasFernandez force-pushed the mfernandez/syspath-doc-fixes branch from 451931b to 2aa7261 Compare October 14, 2026 21:21
@MatiasFernandez MatiasFernandez changed the title Stop saying gemdb file.py leaves the script's directory off sys.path Drop the claim that gemdb file.py leaves the script's directory off sys.path Oct 14, 2026
@MatiasFernandez
MatiasFernandez marked this pull request as ready for review October 14, 2026 21:22
@jgfoster
jgfoster merged commit 0fafae7 into main Oct 14, 2026
5 checks passed
@jgfoster
jgfoster deleted the mfernandez/syspath-doc-fixes branch October 14, 2026 23:54
@jgfoster jgfoster mentioned this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants