[#114348] [Ruby master Feature#19832] Method#destructive?, UnboundMethod#destructive? — "sawa (Tsuyoshi Sawada) via ruby-core" <ruby-core@...>

Issue #19832 has been reported by sawa (Tsuyoshi Sawada).

15 messages 2023/08/06

[#114365] [Ruby master Bug#19834] Segmentation fault while running in docker — "ramachandran@... (Ramachandran A) via ruby-core" <ruby-core@...>

Issue #19834 has been reported by ramachandran@mallow-tech.com (Ramachandran A).

7 messages 2023/08/09

[#114380] [Ruby master Bug#19837] Concurrent calls to Process.waitpid2 misbehave on Ruby 3.1 & 3.2 — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>

Issue #19837 has been reported by kjtsanaktsidis (KJ Tsanaktsidis).

7 messages 2023/08/11

[#114399] [Ruby master Feature#19839] Need a method to check if two ranges overlap — "shouichi (Shouichi KAMIYA) via ruby-core" <ruby-core@...>

Issue #19839 has been reported by shouichi (Shouichi KAMIYA).

27 messages 2023/08/18

[#114410] [Ruby master Bug#19841] Marshal.dump stack overflow with recursive Time — "segiddins (Samuel Giddins) via ruby-core" <ruby-core@...>

Issue #19841 has been reported by segiddins (Samuel Giddins).

9 messages 2023/08/18

[#114422] [Ruby master Feature#19842] Intorduce M:N threads — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

Issue #19842 has been reported by ko1 (Koichi Sasada).

30 messages 2023/08/21

[#114590] [Ruby master Bug#19857] Eval coverage is reset after each `eval`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19857 has been reported by ioquatix (Samuel Williams).

21 messages 2023/08/30

[ruby-core:114465] [Ruby master Bug#13269] test/readline/test_readline.rb and mingw

From: "jeremyevans0 (Jeremy Evans) via ruby-core" <ruby-core@...>
Date: 2023-08-23 19:03:20 UTC
List: ruby-core #114465
Issue #13269 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Assigned to Closed

The readline extension was removed in commit:59fd67fc3d405e529e038172e769ff20a8fb5535.  If this is still an issue, please file it upstream: https://github.com/ruby/readline-ext

----------------------------------------
Bug #13269: test/readline/test_readline.rb and mingw
https://bugs.ruby-lang.org/issues/13269#change-104233

* Author: MSP-Greg (Greg L)
* Status: Closed
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* ruby -v: ruby 2.5.0dev (2017-03-02 trunk 57755) [x64-mingw32]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
When running test-all on a mingw build, [`test_readline.rb`](https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb) generates failures and errors.  Several of the errors are due to the `with_temp_stdio` method in `test_readline.rb`.  It also leaves several undeleted files in the temp dir.

Current link is: [TestReadline#with_temp_stdio](https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L580-L586)

The current code is:

```ruby
def with_temp_stdio
  Tempfile.create("test_readline_stdin") {|stdin|
    Tempfile.create("test_readline_stdout") {|stdout|
      yield stdin, stdout
    }
  }
end
```

Replacing it with the following solved the problems.

```ruby
  def with_temp_stdio
    stdin =  Tempfile.new("test_readline_stdin")
    stdout = Tempfile.new("test_readline_stdout")
    yield stdin, stdout
    if stdout
      stdout.closed? ? stdout.unlink : stdout.close!
    end
    if stdin
      stdin.closed?  ? stdin.unlink  : stdin.close!
    end
  end
```

I can only test on Windows, but I assume the changed code would work on other os's.  If someone could test it, I'd submit a PR.  Maybe the code in `Tempfile::Remover` is really where the change should occur, but I haven't looked at that.

After this update, I only had one failure and three errors.  Text below.

Odd thing for two errors it that they report `NoMethodError: undefined method assert_separately`, but the highlighted line is `return if assert_under_utf8`. I didn't do an exhaustive search, but I can't find a reference to that function.  But, I'm pulling the test files out of ruby and running separately...

```
Failure: test_input_metachar(TestReadline)
D:/r_test/Readline/test_readline.rb:420:in `test_input_metachar'
     417:       wo = w.dup
     418:       wo.write("\C-re\ef\n")
     419:     end
  => 420:     assert_equal("hello", line, bug6601)
     421:   ensure
     422:     wo.close
     423:     Readline.delete_text
[ruby-core:45682]
<"hello">(UTF-8) expected but was
<"hfello">(IBM437)

diff:
? hfello

? Encoding: UTF-8
?           IBM437
====================================================================================================================================================
Error: test_input_metachar_multibyte(TestReadline):
  NoMethodError: undefined method `assert_separately' for #<TestReadline:0x00000003bcfef0>
  Did you mean?  assert_empty
D:/r_test/Readline/test_readline.rb:618:in `assert_under_utf8'
D:/r_test/Readline/test_readline.rb:429:in `test_input_metachar_multibyte'
     426:
     427:   def test_input_metachar_multibyte
     428:     unless Encoding.find("locale") == Encoding::UTF_8
  => 429:       return if assert_under_utf8
     430:       skip 'this test needs UTF-8 locale'
     431:     end
     432:     bug6602 = '[ruby-core:45683]'
====================================================================================================================================================
Error: test_refresh_line(TestReadline):
  NoMethodError: undefined method `assert_ruby_status' for #<TestReadline:0x00000003bcf6f8>
  Did you mean?  assert_raises
D:/r_test/Readline/test_readline.rb:459:in `block (2 levels) in test_refresh_line'
     456:     bug6232 = '[ruby-core:43957] [Bug #6232] refresh_line after set_screen_size'
     457:     with_temp_stdio do |stdin, stdout|
     458:       replace_stdio(stdin.path, stdout.path) do
  => 459:         assert_ruby_status(%w[-rreadline -], <<-'end;', bug6232)
     460:           Readline.set_screen_size(40, 80)
     461:           Readline.refresh_line
     462:         end;
D:/r_test/Readline/test_readline.rb:567:in `block (2 levels) in replace_stdio'
D:/r_test/Readline/test_readline.rb:557:in `open'
D:/r_test/Readline/test_readline.rb:557:in `block in replace_stdio'
D:/r_test/Readline/test_readline.rb:556:in `open'
D:/r_test/Readline/test_readline.rb:556:in `replace_stdio'
D:/r_test/Readline/test_readline.rb:458:in `block in test_refresh_line'
D:/r_test/Readline/test_readline.rb:583:in `with_temp_stdio'
D:/r_test/Readline/test_readline.rb:457:in `test_refresh_line'
====================================================================================================================================================
Error: test_using_quoting_detection_proc_with_multibyte_input(TestReadline):
  NoMethodError: undefined method `assert_separately' for #<TestReadline:0x00000003bcf2c0>
  Did you mean?  assert_empty
D:/r_test/Readline/test_readline.rb:618:in `assert_under_utf8'
D:/r_test/Readline/test_readline.rb:517:in `test_using_quoting_detection_proc_with_multibyte_input'
     514:     saved_completer_word_break_characters = Readline.completer_word_break_characters
     515:     return unless Readline.respond_to?(:quoting_detection_proc=)
     516:     unless Encoding.find("locale") == Encoding::UTF_8
  => 517:       return if assert_under_utf8
     518:       skip 'this test needs UTF-8 locale'
     519:     end
     520:
```




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread

Prev Next