Skip to content

Normalize path-like objects before retaining the store filename - #58

Open
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/coerce-file-path
Open

Normalize path-like objects before retaining the store filename#58
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/coerce-file-path

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Normalize the retained filename with File.path. PStore accepts path-like inputs, but a File object is interpolated as its object representation during atomic saving, and path does not return the documented string.

Reproduction and verification

String, Pathname and open File inputs were checked for string path return and ultra_safe write/read round trips. The File input fails its atomic save before this correction.

  • External focused corpus: 6 verified on this isolated branch under rbenv Ruby 4.0.6.
  • Existing upstream RBENV_VERSION=4.0.6 rbenv exec rake test: 13 tests / 26 assertions, zero failures before and after.
  • All files and injected failures are confined to scratch storage; no production operations.
  • No repository tests added or modified under the contributor's task constraint. Other Ruby versions and native Windows were not executed locally.

Breaking-change notes and limitations

Path-like inputs are normalized to strings. Existing String inputs retain their value and behavior; no path freezing or global path-policy change.

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.

1 participant