Skip to content

Fix history saving when directory writability is unreliable#1220

Open
st0012 wants to merge 3 commits into
masterfrom
codex/fix-windows-history-save
Open

Fix history saving when directory writability is unreliable#1220
st0012 wants to merge 3 commits into
masterfrom
codex/fix-windows-history-save

Conversation

@st0012
Copy link
Copy Markdown
Member

@st0012 st0012 commented May 31, 2026

Problem

Solution

  • This changes history saving to normalize permissions only for an existing history file, then attempt the real File.open write and report ENOENT, EACCES, or EPERM from that operation.
  • This keeps the existing owner-only permission normalization behavior for existing history files while removing the parent directory writable? gate.
  • This adds a Windows-only regression test that sets a temporary history directory read-only with attrib +R, verifies that a normal file write still succeeds, runs an IRB session, and asserts that the history file is saved without warnings in test_history_windows.rb.
  • This shares the history test fixture through HistoryTestCase, so HistoryTest and HistoryWindowsTest use the same setup without making the Windows regression inherit the full non-Windows test suite.
  • The new file is included by the repository's test/irb/**/test_*.rb test pattern, while its own windows? guard omits the case on non-Windows platforms.

@st0012 st0012 added the bug Something isn't working label May 31, 2026
@st0012 st0012 marked this pull request as ready for review May 31, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants