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 -----
  • 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

November 2024

  • 2 participants
  • 185 discussions
[ruby-core:111966] [Ruby master Feature#19366] Rename/alias Refinedment#refined_class => #refined_module
by zverok (Victor Shepelev) 19 Nov '24

19 Nov '24
Issue #19366 has been reported by zverok (Victor Shepelev). ---------------------------------------- Feature #19366: Rename/alias Refinedment#refined_class => #refined_module https://bugs.ruby-lang.org/issues/19366 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal ---------------------------------------- In #12737, `Refinement#refined_class` is introduced. As "module" is more generic concept than "class", the name misleadingly implies that either this method doesn't returns refined _modules_, or modules can't be refined. This is obviously not true and trivially disproved: ```ruby module Refs refine Enumerable do def foo = puts 'foo' end end Refs.refinements[0].refined_class #=> Enumerable. Which is, well, not a class. # The refinement is usable, so it is not a mute concept: using Refs [1, 2, 3].foo # prints "foo" successfully ``` I believe we refer to "modules" when some feature applies to modules and classes. Unless there is some deeper consideration for the current naming (I don't see justification in #12737, but I might miss something), the method should be renamed or aliased. PS: Sorry for a huge amount of "nitpicky" issues after the version release. Typically, those concerns emerge while I am working on the [changelog](https://rubyreferences.github.io/rubychanges/), and I am usually trying to start the work at least a month before the release. Unfortunately, due to you-know-what, I was unable to do it in time this year. After the 3.2 changelog, I plan to switch to the "master changelog" approach (following the development with the "current unreleased changes" document) this year. Unless I'll be unable to due to reasons not in my control. -- https://bugs.ruby-lang.org/
4 3
0 0
[ruby-core:119960] [Ruby master Feature#20901] What's status of Refinement#refined_class?
by hsbt (Hiroshi SHIBATA) 19 Nov '24

19 Nov '24
Issue #20901 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Feature #20901: What's status of Refinement#refined_class? https://bugs.ruby-lang.org/issues/20901 * Author: hsbt (Hiroshi SHIBATA) * Status: Assigned * Assignee: shugo (Shugo Maeda) ---------------------------------------- I found the following code in `eval.c`. ``` rb_warn_deprecated_to_remove("3.4", "Refinement#refined_class", "Refinement#target"); ``` @shugo Should we remove `Refinement#refined_class` at Ruby 3.4? -- https://bugs.ruby-lang.org/
1 0
0 0
[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
  • ← Newer
  • 1
  • ...
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.