Can't write history on irb exit on Windows

オープン
#1,219 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
ruby
領域
cli

調査の方向性

history_file.dirname.writable? を確認する IRB の履歴保存パスから始め、Windows 上の IRB 1.13.1 および 1.14.3 の動作と比較します。ユーザープロファイルの履歴ファイルを使って警告を再現し、その後、IRB を終了すると誤った権限警告なしで履歴が保存され、他のディレクトリチェックは引き続き正しく動作することを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug

On my Windows machine, as of ruby 3.4.9 irb 1.14.3, the irb can no longer write history on exit and shows the following warning:

Can't write history to "..." due to insufficient permissions.

I can write manually into the same history file from within irb just fine. The "problem" seems to be caused by the changes in 52307f9. I first suspected history_file.chmod 0o600 failing on Windows, but it is actually history_file.dirname.writable? that returns false, despite I am able to write files from irb into my user profile directory just fine.

Saving history worked correctly in ruby 3.3.11 irb 1.13.1, probably because it simply did not have the directory writable check back then.

The .writable? check seems to work correctly for other directories but returns false for the user profile in both ruby versions. I am not sure why, I checked the permissions and they look fine. As mentioned, the actual files can be written without any problems.

主要言語
Ruby
スター
477
フォーク
165
平均マージ
1日 19時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ruby/irb のほかの issue

ruby/irb の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。