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

May 2024

  • 3 participants
  • 208 discussions
[ruby-core:117778] [Ruby master Bug#18995] IO#set_encoding sometimes set an IO's internal encoding to the default external encoding
by javanthropus (Jeremy Bopp) 05 May '24

05 May '24
Issue #18995 has been updated by javanthropus (Jeremy Bopp). @jeremyevans, did you ever take a look at this issue when I referenced it in #18899? The behavior is unchanged in Ruby 3.3. The script above prints the following: ``` external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-2> external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-1> external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-3> ``` I expected it to print this: ``` external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-2> external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-2> external encoding: #<Encoding:UTF-8> internal encoding: #<Encoding:ISO-8859-4> ``` ---------------------------------------- Bug #18995: IO#set_encoding sometimes set an IO's internal encoding to the default external encoding https://bugs.ruby-lang.org/issues/18995#change-108185 * Author: javanthropus (Jeremy Bopp) * Status: Open * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- This script demonstrates the behavior: ```ruby def show(io) printf( "external encoding: %-25p internal encoding: %-25p\n", io.external_encoding, io.internal_encoding ) end Encoding.default_external = 'iso-8859-1' Encoding.default_internal = 'iso-8859-2' File.open('/dev/null') do |f| f.set_encoding('utf-8', nil) show(f) # f.internal_encoding is iso-8859-2, as expected f.set_encoding('utf-8', 'invalid') show(f) # f.internal_encoding is now iso-8859-1! Encoding.default_external = 'iso-8859-3' Encoding.default_internal = 'iso-8859-4' show(f) # f.internal_encoding is now iso-8859-3! end ``` In the 1st case, we see that the IO's internal encoding is set to the current setting of Encoding.default_internal. In the 2nd case, the IO's internal encoding is set to Encoding.default_external instead. The 3rd case is more interesting because it shows that the IO's internal encoding is actually following the current setting of Encoding.default_external. It didn't just copy it when #set_encoding was called. It changes whenever Encoding.default_external changes. What should the correct behavior be? -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:117774] [Ruby master Bug#20471] Problem creating a file on a windows share and copy it afterwards
by budiljak (Benjamin Udiljak) 05 May '24

05 May '24
Issue #20471 has been reported by budiljak (Benjamin Udiljak). ---------------------------------------- Bug #20471: Problem creating a file on a windows share and copy it afterwards https://bugs.ruby-lang.org/issues/20471 * Author: budiljak (Benjamin Udiljak) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Hi, in my Rails application I have the requirement to create a file and copy it to another place on the same windows share. But if I write the file with `File` class and try to copy it with `FileUtils.cp` it hangs indefinitely without any error message. I can't even kill the ruby process. You can easily reproduce the bug by entering this in IRB: ``` filename = "/mnt/windows_share/abc"; File.open(filename, 'wb') { |f| f.write("123" * 1000) }; FileUtils.cp(filename, filename + "d") ``` I tested this on a Ubuntu 22.04 server in the AWS cloud. I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help. Probably it's a problem in connection with the `cifs-utils` package. Please come back to me if you need further information. Regards! Ben -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:117764] [Ruby master Feature#20469] Add a JSON addition for Enumerator::ArithmeticSequence
by shan (Shannon Skipper) 04 May '24

04 May '24
Issue #20469 has been reported by shan (Shannon Skipper). ---------------------------------------- Feature #20469: Add a JSON addition for Enumerator::ArithmeticSequence https://bugs.ruby-lang.org/issues/20469 * Author: shan (Shannon Skipper) * Status: Open ---------------------------------------- There's a JSON addition for `Range` but one wasn't added for `Enumerator::ArithmeticSequence` when it was introduced. This little PR adds a JSON addition for ArithmeticSequence for parity with a normal Range. https://github.com/ruby/ruby/pull/10720/files ``` ruby ## # Already supported require 'json/add/range' (0..42).to_json ## # Proposed addition require 'json/add/arithmetic_sequence' ((0..42) % 3).to_json ``` I was curious about adding it to `add/core.rb` but it seems like that could be considered separately, especially since there are classes like Set that could also be considered for inclusion now that it's a core class. -- https://bugs.ruby-lang.org/
1 1
0 0
[ruby-core:117750] [Ruby master Bug#20464] Redundant returns are unreachable in coverage
by kddnewton (Kevin Newton) 03 May '24

03 May '24
Issue #20464 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Bug #20464: Redundant returns are unreachable in coverage https://bugs.ruby-lang.org/issues/20464 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- With the following code: ```ruby def meth_return(a) return if a return end ``` If you run coverage on it, it's not possible for it to hit line 3, because there isn't a line event, because the return node was eliminated from the AST before it was compiled. There is a `putnil` instruction, so it's possible for us to attach a line event for it, but the compiler doesn't today. -- https://bugs.ruby-lang.org/
2 5
0 0
[ruby-core:117754] [Ruby master Bug#20467] Prism creates a wrong ConstantReadNode for `Bar::Foo = 42`
by mame (Yusuke Endoh) 03 May '24

03 May '24
Issue #20467 has been reported by mame (Yusuke Endoh). ---------------------------------------- Bug #20467: Prism creates a wrong ConstantReadNode for `Bar::Foo = 42` https://bugs.ruby-lang.org/issues/20467 * Author: mame (Yusuke Endoh) * Status: Open * Assignee: kddnewton (Kevin Newton) * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Currently, Prism creates the following AST for `Bar::Foo = 42` ``` irb(main):001> Prism.parse(%q(Bar::Foo = 42)).value => @ ProgramNode (location: (1,0)-(1,13)) ├── locals: [] └── statements: @ StatementsNode (location: (1,0)-(1,13)) └── body: (length: 1) └── @ ConstantPathWriteNode (location: (1,0)-(1,13)) ├── target: │ @ ConstantPathNode (location: (1,0)-(1,8)) │ ├── parent: │ │ @ ConstantReadNode (location: (1,0)-(1,3)) │ │ └── name: :Bar │ ├── child: │ │ @ ConstantReadNode (location: (1,5)-(1,8)) │ │ └── name: :Foo │ └── delimiter_loc: (1,3)-(1,5) = "::" ├── operator_loc: (1,9)-(1,10) = "=" └── value: @ IntegerNode (location: (1,11)-(1,13)) ├── flags: decimal └── value: 42 ``` Note that it includes `ConstantReadNode(name: :Foo)`. I believe this is a bug because `Bar::Foo = 42` does not read a constant `Foo`. Also, `Foo` and `Bar::Foo` generates the followings. ``` irb(main):002> Prism.parse(%q(Foo)).value => @ ProgramNode (location: (1,0)-(1,3)) ├── locals: [] └── statements: @ StatementsNode (location: (1,0)-(1,3)) └── body: (length: 1) └── @ ConstantReadNode (location: (1,0)-(1,3)) └── name: :Foo irb(main):003> Prism.parse(%q(Bar::Foo)).value => @ ProgramNode (location: (1,0)-(1,8)) ├── locals: [] └── statements: @ StatementsNode (location: (1,0)-(1,8)) └── body: (length: 1) └── @ ConstantPathNode (location: (1,0)-(1,8)) ├── parent: │ @ ConstantReadNode (location: (1,0)-(1,3)) │ └── name: :Bar ├── child: │ @ ConstantReadNode (location: (1,5)-(1,8)) │ └── name: :Foo └── delimiter_loc: (1,3)-(1,5) = "::" ``` Note that both have the same subtree of `ConstantReadNode(name: :Foo)`. It is very confusing because `Foo` (non-scoped read of `Foo`) and `Bar::Foo` (scoped read of `Foo`) have very different meanings. I think the following design would be desirable. ``` # Foo::Bar=42 ConstantPathWriteNode( base: ConstantReadNode(name: ConstantNameNode(:Foo)), name: ConstantNameNode(:Bar), value: 42 ) # Foo ConstantReadNode(name: ConstantNameNode(:Foo)) # Foo::Bar ConstantPathReadNode( base: ConstantReadNode(name: ConstantNameNode(:Foo)), name: ConstantNameNode(:Bar), ) ``` -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:117753] [Ruby master Bug#20466] Interpolated regular expressions have different encoding than interpolated strings
by tenderlovemaking (Aaron Patterson) 02 May '24

02 May '24
Issue #20466 has been reported by tenderlovemaking (Aaron Patterson). ---------------------------------------- Bug #20466: Interpolated regular expressions have different encoding than interpolated strings https://bugs.ruby-lang.org/issues/20466 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- When the encoding is set to US-ASCII, interpolated strings can have different encoding than interpolated regular expressions. I think they should have the same encoding: ```ruby # encoding: US-ASCII t0 = '\\xc1' t1 = "#{t0}" re = /#{t0}/ p [t0.encoding, t1.encoding, re.encoding] ``` Output is: ``` $ ./miniruby -v test.rb ruby 3.4.0dev (2024-05-02T15:27:18Z master 7c0cf71049) [arm64-darwin23] [#<Encoding:US-ASCII>, #<Encoding:US-ASCII>, #<Encoding:BINARY (ASCII-8BIT)>] ``` -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:117748] [Ruby master Bug#20463] Ruby fails to generate warning for require syslog
by tyatin (Serg Tyatin) 02 May '24

02 May '24
Issue #20463 has been reported by tyatin (Serg Tyatin). ---------------------------------------- Bug #20463: Ruby fails to generate warning for require syslog https://bugs.ruby-lang.org/issues/20463 * Author: tyatin (Serg Tyatin) * Status: Open * ruby -v: 3.3.1 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ``` docker run -it ruby:3.3.1 bash touch Gemfile bundle bundle exec ruby -e "require '/usr/local/lib/ruby/3.3.0/x86_64-linux/syslog'" /usr/local/lib/ruby/3.3.0/bundled_gems.rb:130:in `<': comparison of String with nil failed (ArgumentError) msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}." ^^^^^^^^^^ from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:130:in `build_message' from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:126:in `warning?' from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:71:in `block (2 levels) in replace_require' from -e:1:in `<main>' ``` the same happens on M1 mac -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:117680] [Ruby master Bug#20451] Bad Ruby 3.1.5 backport causes fiddle to fail to build
by Bo98 (Bo Anderson) 01 May '24

01 May '24
Issue #20451 has been reported by Bo98 (Bo Anderson). ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b…. The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. -- https://bugs.ruby-lang.org/
3 4
0 0
  • ← Newer
  • 1
  • ...
  • 18
  • 19
  • 20
  • 21
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.