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
  • ----- 2026 -----
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • 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

November 2025

  • 1 participants
  • 172 discussions
[ruby-core:123642] [Ruby Bug#13671] Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain characters
by nagachika (Tomoyuki Chikanaga) 02 Nov '25

02 Nov '25
Issue #13671 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ruby_3_3 commit:f0feca1a8495eba2706a7914f0c4f8128c281366. ---------------------------------------- Bug #13671: Regexp with lookbehind and case-insensitivity raises RegexpError only on strings with certain characters https://bugs.ruby-lang.org/issues/13671#change-115026 * Author: dschweisguth (Dave Schweisguth) * Status: Closed * Assignee: duerst (Martin Dürst) * ruby -v: 2.4.1 * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ---------------------------------------- Here is a test program: ~~~ ruby def test(description) begin yield puts "#{description} is OK" rescue RegexpError puts "#{description} raises RegexpError" end end test("ass, case-insensitive, special") { /(?<!ass)/i =~ '✨' } test("bss, case-insensitive, special") { /(?<!bss)/i =~ '✨' } test("as, case-insensitive, special") { /(?<!as)/i =~ '✨' } test("ss, case-insensitive, special") { /(?<!ss)/i =~ '✨' } test("ass, case-sensitive, special") { /(?<!ass)/ =~ '✨' } test("ass, case-insensitive, regular") { /(?<!ass)/i =~ 'x' } ~~~ Running the test program with Ruby 2.4.1 (macOS) gives ~~~ ass, case-insensitive, special raises RegexpError bss, case-insensitive, special raises RegexpError as, case-insensitive, special is OK ss, case-insensitive, special is OK ass, case-sensitive, special is OK ass, case-insensitive, regular is OK ~~~ The RegexpError is "invalid pattern in look-behind: /(?<!ass)/i (RegexpError)" Side note: in the real code in which I found this error I was able to work around the error by using (?i) after the lookbehind instead of //i. Running the test program with Ruby 2.3.4 does not report any RegexpErrors. I think this is a regression, although I might be wrong and it might be saving me from an incorrect result with certain strings. ---Files-------------------------------- test.rb (531 Bytes) -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:123623] [Ruby Bug#21658] Encoding objects are dumped with an encoding of US-ASCII
by headius (Charles Nutter) 01 Nov '25

01 Nov '25
Issue #21658 has been reported by headius (Charles Nutter). ---------------------------------------- Bug #21658: Encoding objects are dumped with an encoding of US-ASCII https://bugs.ruby-lang.org/issues/21658 * Author: headius (Charles Nutter) * Status: Open * ruby -v: ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [arm64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- All encodings get Marshal.dump'ed with an encoding instance variable: ``` $ cx ruby-3.4 ruby -e 'Encoding.constants.each { p Marshal.dump(Encoding.const_get(it)) }' "\x04\bIu:\rEncoding\x10MacJapanese\x06:\x06EF" "\x04\bIu:\rEncoding\x10MacJapanese\x06:\x06EF" "\x04\bIu:\rEncoding\rUS-ASCII\x06:\x06EF" "\x04\bIu:\rEncoding\rUS-ASCII\x06:\x06EF" "\x04\bIu:\rEncoding\x10MacJapanese\x06:\x06EF" "\x04\bIu:\rEncoding\nUTF-7\x06:\x06EF" "\x04\bIu:\rEncoding\nUTF-8\x06:\x06EF" "\x04\bIu:\rEncoding\nUTF-7\x06:\x06EF" ... ``` This despite the fact that an Encoding does not have an encoding: ``` $ cx ruby-3.4 ruby -e 'Encoding::UTF_8.encoding' -e:1:in '<main>': undefined method 'encoding' for an instance of Encoding (NoMethodError) ``` Compare with JRuby output: ``` $ cx jruby-10.0.2.0 ruby -e 'p Marshal.dump(Encoding::UTF_8)' "\x04\bu:\rEncoding\nUTF-8" ``` This extra instance variable data causes the output to be unloadable by JRuby, because an Encoding object cannot itself have an encoding: ``` $ cx jruby-10.0.2.0 ruby -e 'p Marshal.load("\x04\bIu:\rEncoding\nUTF-8\x06:\x06EF")' ArgumentError: UTF-8is not enc_capable load at org/jruby/RubyMarshal.java:165 <main> at -e:1 ``` This is reported as a JRuby issue here: https://github.com/jruby/jruby/issues/9050 Encoding should not marshal with an encoding it does not actually have. -- https://bugs.ruby-lang.org/
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 15
  • 16
  • 17
  • 18
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.