From: "Eregon (Benoit Daloze) via ruby-core" Date: 2025-05-16T12:15:50+00:00 Subject: [ruby-core:122145] [Ruby Bug#20009] Marshal.load raises exception when load dumped class include non-ASCII Issue #20009 has been updated by Eregon (Benoit Daloze). @nobu What happens when using your patch to Marshal.dump a class and then trying to load it on an older Ruby? Will it create an instance variable `E` or error? I guess if there is no matching BINARY constant it would error anyway, but if there is it would set that instance variable `E` or different error. ---------------------------------------- Bug #20009: Marshal.load raises exception when load dumped class include non-ASCII https://bugs.ruby-lang.org/issues/20009#change-113296 * Author: ippachi (Kazuya Hatanaka) * Status: Open * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ## Reproduction code ```ruby class C���������; end Marshal.load(Marshal.dump(C���������)) ``` ## Actual result ``` :34:in `load': undefined class/module C\xE3\x82\xAF\xE3\x83\xA9\xE3\x82\xB9 (ArgumentError) from marshal.rb:2:in `
' ``` ## Expected result Returns `C���������` ## Impacted area An exception is raised in Rails under the following conditions * minitest is used with default settings * Parallel execution with parallelize * test class names contain non-ASCII characters The default parallelization uses DRb, and Marshal is used inside DRb. ## Other After trying various things, I thought I could fix it by making `rb_path_to_class` support strings containing non-ASCII characters, but I couldn't find anything more than that. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/