rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Use `File.open` instead of `IO.sysopen`

Open soutaro opened this issue 1 year ago • 0 comments

The default.close line sometimes raises an error:

https://github.com/ruby/actions/actions/runs/9667790393/job/26670618280#step:16:330

  ===============================================================================
  Error: test_grpowned?(FileTestSingletonTest): Errno::EBADF: Bad file descriptor
  test/stdlib/FileTest_test.rb:13:in 'IO#close'
  test/stdlib/FileTest_test.rb:13:in 'FileTestSingletonTest#with_path_io'
  test/stdlib/FileTest_test.rb:73:in 'FileTestSingletonTest#test_grpowned?'
  test/stdlib/io/Buffer_test.rb:67: warning: IO::Buffer is experimental and both the Ruby and C interface may change in the future!
  ===============================================================================

It's not very clear what is happening, but this PR is trying to use File instance instead of IO instance. Will run the Ruby CI with this patch and see what will happen.

soutaro avatar Jun 26 '24 03:06 soutaro