[#108552] [Ruby master Bug#18782] Race conditions in autoload when loading the same feature with multiple threads. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18782 has been reported by ioquatix (Samuel Williams).
11 messages
2022/05/14
[ruby-core:108624] [Ruby master Bug#18407] Behavior difference between integer and string flags to File creation
From:
deivid <noreply@...>
Date:
2022-05-19 09:08:59 UTC
List:
ruby-core #108624
Issue #18407 has been updated by deivid (David Rodr鱈guez).
Thanks @mame!
I still think at least the documentation should be updated to mention this, because the current wording makes me think the alternatives I tried should be equivalent and both work: https://ruby-doc.org/core-3.1.2/IO.html#method-c-new.
----------------------------------------
Bug #18407: Behavior difference between integer and string flags to File creation
https://bugs.ruby-lang.org/issues/18407#change-97673
* Author: deivid (David Rodr鱈guez)
* Status: Closed
* Priority: Normal
* ruby -v: 3.0.3
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Hi!
I was under the impression that these two commands should either both work of both fail, however they behave differently.
```shell-session
$ ruby -ropen-uri -EUTF-8:UTF-8 -e 'f = File.new("foo", "wb"); f.write URI.open("https://rubygems.org/gems/rake-13.0.6.gem").read'
$ ruby -ropen-uri -EUTF-8:UTF-8 -e 'f = File.new("foo", File::WRONLY | File::TRUNC | File::BINARY); f.write URI.open("https://rubygems.org/gems/rake-13.0.6.gem").read'
-e:1:in `write': "\\x8B" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
from -e:1:in `<main>'
```
Could be an actual bug, and me misunderstanding the documentation. In any case it seemed worth reporting.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>