[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82678] [Ruby trunk Bug#13874] String#valid_encoding? has side effects
From:
nobu@...
Date:
2017-09-06 14:42:17 UTC
List:
ruby-core #82678
Issue #13874 has been updated by nobu (Nobuyoshi Nakada). Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED 2.2.6 and later need the backport. ---------------------------------------- Bug #13874: String#valid_encoding? has side effects https://bugs.ruby-lang.org/issues/13874#change-66513 * Author: ojundt (Oliver Jundt) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16] * Backport: 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED ---------------------------------------- I noticed the result of `String#encode` changes after a call to `String#valid_encoding?`. Other side effects were not visible so far. Based on the documentation and intuition I would expect `#valid_encoding?` to be an operation without side effects. ~~~ ruby content = "\xE5".dup.force_encoding(Encoding::ASCII_8BIT) content.encode(Encoding::UTF_8, Encoding::UTF_8, invalid: :replace, replace: '?') => "?" content.valid_encoding? content.encode(Encoding::UTF_8, Encoding::UTF_8, invalid: :replace, replace: '?') => "\xE5" ~~~ -- 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>