ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-core

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-core@ml.ruby-lang.org

  • 2 participants
  • 3312 discussions
[ruby-core:119940] [Ruby master Bug#20896] io/nonblock operations not ractor-safe
by chucke (Tiago Cardoso) 16 Nov '24

16 Nov '24
Issue #20896 has been reported by chucke (Tiago Cardoso). ---------------------------------------- Bug #20896: io/nonblock operations not ractor-safe https://bugs.ruby-lang.org/issues/20896 * Author: chucke (Tiago Cardoso) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- This prevents from calling `socket.nonblock = true` in a non-main ractor. https://github.com/ruby/io-nonblock/pull/14 -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:119462] [Ruby master Bug#20785] Should `a in b, and c` `a in b, or c` `a in b, rescue c` be syntax ok?
by tompng (tomoya ishida) 16 Nov '24

16 Nov '24
Issue #20785 has been reported by tompng (tomoya ishida). ---------------------------------------- Bug #20785: Should `a in b, and c` `a in b, or c` `a in b, rescue c` be syntax ok? https://bugs.ruby-lang.org/issues/20785 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 3.4.0dev (2024-10-04T03:22:53Z master 939ec9f080) +YJIT +MN +PRISM [arm64-darwin22] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- This code is accepted in parse.y but rejected in prism ~~~ruby tap do a in b, and c a in b, or c a in b, rescue c end # parsed as tap do (a in b,;) and c (a in b,;) or c a in b,; rescue c end ~~~ I think these should be rejected like prism (parse.y accepts) ~~~ruby a in b, and c a in b, and c tap do a in b, rescue c end ~~~ I think these should be accepted like parse.y (prism rejects) ~~~ruby tap do a in b, end tap do a in b, rescue end ~~~ -- https://bugs.ruby-lang.org/
7 9
0 0
[ruby-core:119934] [Ruby master Bug#20895] Network related test failures
by vo.x (Vit Ondruch) 14 Nov '24

14 Nov '24
Issue #20895 has been reported by vo.x (Vit Ondruch). ---------------------------------------- Bug #20895: Network related test failures https://bugs.ruby-lang.org/issues/20895 * Author: vo.x (Vit Ondruch) * Status: Open * ruby -v: ruby 3.4.0dev (2024-11-14 master 54ff9d3525) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Testing recent Ruby in Fedora Rawhide, I have started to observe following errors: ~~~ 183) Failure: TestSocket_TCPSocket#test_initialize_resolv_timeout_with_connection_failure [/builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:284]: [Errno::ETIMEDOUT] exception expected, not #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 41615>. 184) Failure: TestSocket_TCPSocket#test_initialize_with_hostname_resolution_failure_after_connection_failure [/builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:303]: [Socket::ResolutionError] exception expected, not #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 43017>. 185) Failure: TestNetHTTP_v1_2#test_timeout_during_HTTP_session [/builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/net/http/test_http.rb:625]: [Net::ReadTimeout] exception expected, not #<Errno::ECONNREFUSED: Failed to open TCP connection to localhost:43017 (Connection refused - connect(2) for "localhost" port 43017)>. 186) Error: TestSocket_TCPSocket#test_initialize_v6_hostname_resolution_failed_and_v4_hostname_resolution_is_success: Socket::ResolutionError: getaddrinfo(3): Non-recoverable failure in name resolution /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:266:in 'TCPSocket#initialize' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:266:in 'IO.new' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:266:in '<main>' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:259:in 'TestSocket_TCPSocket#test_initialize_v6_hostname_resolution_failed_and_v4_hostname_resolution_is_success' 187) Error: TestSocket_TCPSocket#test_initialize_v6_hostname_resolved_earlier_and_v6_server_is_not_listening: Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 39421 /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:222:in 'TCPSocket#initialize' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:222:in 'IO.new' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:222:in '<main>' /builddir/build/BUILD/ruby-3.4.0_20241114git54ff9d3525-build/ruby-3.4.0-54ff9d3525/test/socket/test_tcp.rb:213:in 'TestSocket_TCPSocket#test_initialize_v6_hostname_resolved_earlier_and_v6_server_is_not_listening' ~~~ Please note that the build system does not have internet access. At least some of the test failures are likely related to #20782 / https://github.com/ruby/ruby/pull/11653 -- https://bugs.ruby-lang.org/
1 1
0 0
[ruby-core:119929] [Ruby master Feature#20894] Allow `Range#last(n)` for beginless ranges with Integer end
by kyanagi (Kouhei Yanagita) 14 Nov '24

14 Nov '24
Issue #20894 has been reported by kyanagi (Kouhei Yanagita). ---------------------------------------- Feature #20894: Allow `Range#last(n)` for beginless ranges with Integer end https://bugs.ruby-lang.org/issues/20894 * Author: kyanagi (Kouhei Yanagita) * Status: Open ---------------------------------------- `Range#last(n)` raises an exception on beginless ranges. ``` (..5).last(3) #=> can't iterate from NilClass (TypeError) ``` Since Ruby 3.3, `Range#reverse_each` for beginless ranges with an integer end has been allowed. ``` (..5).reverse_each { p _1 } #=> 5, 4, 3, 2, 1, ... ``` Therefore, shouldn't `Range#last(n)` for such ranges also be acceptable? ``` # before (..5).last(3) => can't iterate from NilClass (TypeError) # after (..5).last(3) => [3, 4, 5] ``` If this is accepted, a similar change could be considered for `Range#max(n)` as well. https://github.com/ruby/ruby/pull/12084 -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:119892] [Ruby master Feature#20887] Add "latest" version to "docs.ruby-lang.org"
by p8 (Petrik de Heus) 13 Nov '24

13 Nov '24
Issue #20887 has been reported by p8 (Petrik de Heus). ---------------------------------------- Feature #20887: Add "latest" version to "docs.ruby-lang.org" https://bugs.ruby-lang.org/issues/20887 * Author: p8 (Petrik de Heus) * Status: Open ---------------------------------------- Searching for Ruby documentation regularly returns outdated documentation. For example searching for "ruby comparable" : https://www.google.com/search?hl=en&q=ruby%20comparable" returns: - Module: Comparable (Ruby 2.5.8) - Module: Comparable (Ruby 3.0.3) It would be nice if we had a `https://docs.ruby-lang.org/en/latest` that points the latest released version. Older versions could add the "canonical" link to let search engines know what the preferred version is: ```html <link rel="canonical" href="https://docs.ruby-lang.org/en/latest/Comparable.html" /> ``` https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel#canonical This would also allow others to link to this latest versions, instead of hardcoding the version or using "master". -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:119901] [Ruby master Bug#20891] Dir.foreach does not give a static list.
by karasu (karasu k) 13 Nov '24

13 Nov '24
Issue #20891 has been reported by karasu (karasu k). ---------------------------------------- Bug #20891: Dir.foreach does not give a static list. https://bugs.ruby-lang.org/issues/20891 * Author: karasu (karasu k) * Status: Open * ruby -v: 2.7.0 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I was using `Dir.foreach` with a block to batch change filenames. The sample code is something like this: ```rb look_up_table = File.open('look-up-table' ,'w') Dir.foreach('.').each_with_index do |file, index| File.rename(file, index) look_up_table << "#{file}: #{index}\n" end ``` As first I thought it's good, but I found that some indices might be missing. After staring at the look-up table for hours, I realised some files were modified more than once, and this is strange for me. It means that in each iteration of `Dir.foreach`, it acutally **might** fetch the files to see if there are new files that are not in the list before? What I mean **might** is that this situation does not occur anytime, I don't know how to or not to trigger it, but this is what I faced. I am aware that in `Dir.foreach` it might have some `yield` so this behavior might be normal for you guys, but since the function is called `foreach`, I assumed that it should give a list that is not gonna change once it's established. My later fix change to the sample code is: ```rb look_up_table = File.open('look-up-table' ,'w') Dir.foreach('.').to_a.each_with_index do |file, index| File.rename(file, index) look_up_table << "#{file}: #{index}\n" end ``` You can see that I add a `to_a` to change the result from `Dir.foreach` into an array, and rename those files according to it, instead of the result itself. I wonder if this is an old issue but I cannot find it anywhere else. Thanks in advance. Both English and Japanese are welcome! (I know that `Dir.foreach` will give `.` and `..` as well, but let's just forget it for now.) -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:119895] [Ruby master Bug#20889] IO#ungetc and IO#ungetbyte should not cause IO#pos to report an inaccurate position
by javanthropus (Jeremy Bopp) 12 Nov '24

12 Nov '24
Issue #20889 has been reported by javanthropus (Jeremy Bopp). ---------------------------------------- Bug #20889: IO#ungetc and IO#ungetbyte should not cause IO#pos to report an inaccurate position https://bugs.ruby-lang.org/issues/20889 * Author: javanthropus (Jeremy Bopp) * Status: Open * ruby -v: ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ```ruby require 'tempfile' Tempfile.open(encoding: 'utf-8') do |f| f.write('0123456789') f.rewind f.ungetbyte(93) f.pos # => -1; negative value is surprising! end Tempfile.open(encoding: 'utf-8') do |f| f.write('0123456789') f.rewind f.ungetc('a'.encode('utf-8')) f.pos # => -1; similar to the ungetbyte case end Tempfile.open(encoding: 'utf-8:utf-16le') do |f| f.write('0123456789') f.rewind f.ungetc('a'.encode('utf-16le')) f.pos # => 0; maybe should be -2 to match the previous ungetc case? end ``` It doesn't seem logical that `IO#pos` should ever be affected by `IO#ungetc` or `IO#ungetbyte`. The pushed characters or bytes aren't really in the stream source. The value of `IO#pos` implies that jumping directly to that position via `IO#seek` and reading from there would return the same character or byte that was pushed, but the pushed characters or bytes are lost when the operation to seek in the stream is performed. In the case where `IO#pos` is a negative value, attempting to seek to that position actually raises an exception. In the `IO#ungetc` with character conversion case above, it seems unreasonable to make `IO#pos` report an even less correct position. In that case, the position would need to be adjusted by 2 bytes in reverse due to the internal encoding of the stream, but that is completely inconsistent with the behavior of `IO#pos` when reading from the stream normally where it reports the underlying stream's byte position and not the number of transcoded bytes that have been read: ```ruby require 'tempfile' Tempfile.open(encoding: 'utf-8:utf-16le') do |f| f.write('0123456789') f.rewind f.getc.bytesize # => 2; due to the internal encoding of the stream f.pos # => 1; reports actual bytes read from the stream, not transcoded bytes end ``` Attempting to use `IO#pos` when there are characters or bytes pushed into the read buffer by way of `IO#ungetc` or `IO#ungetbyte` should result in one of the following behaviors: 1. Raise and exception 2. Return the stream's position, clearing the read buffer entirely 3. Return the stream's position, ignoring the pushed characters or bytes, and produce a warning -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:117240] [Ruby master Feature#20350] Return chilled string from Symbol#to_s
by Dan0042 (Daniel DeLorme) 12 Nov '24

12 Nov '24
Issue #20350 has been reported by Dan0042 (Daniel DeLorme). ---------------------------------------- Feature #20350: Return chilled string from Symbol#to_s https://bugs.ruby-lang.org/issues/20350 * Author: Dan0042 (Daniel DeLorme) * Status: Open ---------------------------------------- During Ruby 2.7 development there was an attempt to return a frozen string from Symbol#to_s (#16150#note-22) This had to be rolled back due to incompatibility, but now we have chilled strings (#20205) Symbol#to_s can safely return a chilled string, giving developers time to fix warnings before switching to a frozen string. -- https://bugs.ruby-lang.org/
6 9
0 0
[ruby-core:119889] [Ruby master Feature#6648] Provide a standard API for retrieving all command-line flags passed to Ruby
by Eregon (Benoit Daloze) 12 Nov '24

12 Nov '24
Issue #6648 has been updated by Eregon (Benoit Daloze). nobu (Nobuyoshi Nakada) wrote in #note-43: > Saving a path string is not reliable. Why not? Are you thinking if the directory is removed? In that case there is no way to rerun the command faithfully, so an error like Errno::ENOENT is fine. ---------------------------------------- Feature #6648: Provide a standard API for retrieving all command-line flags passed to Ruby https://bugs.ruby-lang.org/issues/6648#change-110580 * Author: headius (Charles Nutter) * Status: Assigned * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- Currently there are no standard mechanisms to get the flags passed to the currently running Ruby implementation. The available mechanisms are not ideal: * Scanning globals and hoping they have not been tweaked to new settings * Using external wrappers to launch Ruby * ??? Inability to get the full set of command-line flags, including flags passed to the VM itself (and probably VM-specific) makes it impossible to launch subprocess Ruby instances with the same settings. A real world example of this is "((%bundle exec%))" when called with a command line that sets various flags, a la ((%jruby -Xsome.vm.setting --1.9 -S bundle exec%)). None of these flags can propagate to the subprocess, so odd behaviors result. The only option is to put the flags into an env var (((|JRUBY_OPTS|)) or ((|RUBYOPT|))) but this breaks the flow of calling a simple command line. JRuby provides mechanisms to get all its command line options, but they require calling Java APIs from Ruby's API set. Rubinius provides its own API for accessing comand-line options, but I do not know if it includes VM-level flags as well as standard Ruby flags. I know there is a (({RubyVM})) namespace in the 2.0 line. If that namespace is intended to be general-purpose for VM-level features, it would be a good host for this API. Something like... ``` class << RubyVM def vm_args; end # returns array of command line args *not* passed to the target script def script; end # returns the script being executed...though this overlaps with $0 def script_args; end # returns args passed to the script...though this overlaps with ARGV, but that is perhaps warranted since ARGV can be modified (i.e. you probably want the original args) end ``` -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:119886] [Ruby master Feature#6648] Provide a standard API for retrieving all command-line flags passed to Ruby
by nobu (Nobuyoshi Nakada) 12 Nov '24

12 Nov '24
Issue #6648 has been updated by nobu (Nobuyoshi Nakada). Eregon (Benoit Daloze) wrote in #note-42: > @nobu True, it would also be helpful to have a way to capture the original CWD. > Then that example would work just fine with `ruby -C subdir -e 'exec(RbConfig.ruby, *Process.ruby_args, "-e", "p :OK", chdir: Process.original_working_directory)'` > (using the naming from https://bugs.ruby-lang.org/issues/6648#note-10 but with `Process`). How to "capture the original CWD"? Keeping a fd open is uselessly expensive in many case, I think. Saving a path string is not reliable. I think the method to run without `-C` options in the CWD is better. ---------------------------------------- Feature #6648: Provide a standard API for retrieving all command-line flags passed to Ruby https://bugs.ruby-lang.org/issues/6648#change-110576 * Author: headius (Charles Nutter) * Status: Assigned * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- Currently there are no standard mechanisms to get the flags passed to the currently running Ruby implementation. The available mechanisms are not ideal: * Scanning globals and hoping they have not been tweaked to new settings * Using external wrappers to launch Ruby * ??? Inability to get the full set of command-line flags, including flags passed to the VM itself (and probably VM-specific) makes it impossible to launch subprocess Ruby instances with the same settings. A real world example of this is "((%bundle exec%))" when called with a command line that sets various flags, a la ((%jruby -Xsome.vm.setting --1.9 -S bundle exec%)). None of these flags can propagate to the subprocess, so odd behaviors result. The only option is to put the flags into an env var (((|JRUBY_OPTS|)) or ((|RUBYOPT|))) but this breaks the flow of calling a simple command line. JRuby provides mechanisms to get all its command line options, but they require calling Java APIs from Ruby's API set. Rubinius provides its own API for accessing comand-line options, but I do not know if it includes VM-level flags as well as standard Ruby flags. I know there is a (({RubyVM})) namespace in the 2.0 line. If that namespace is intended to be general-purpose for VM-level features, it would be a good host for this API. Something like... ``` class << RubyVM def vm_args; end # returns array of command line args *not* passed to the target script def script; end # returns the script being executed...though this overlaps with $0 def script_args; end # returns args passed to the script...though this overlaps with ARGV, but that is perhaps warranted since ARGV can be modified (i.e. you probably want the original args) end ``` -- https://bugs.ruby-lang.org/
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • ...
  • 332
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.