From: "hspem (Per-Erik Martin)" Date: 2022-07-05T12:31:42+00:00 Subject: [ruby-core:109142] [Ruby master Bug#18896] Shellwords.escape(nil) returns "empty" string Issue #18896 has been reported by hspem (Per-Erik Martin). ---------------------------------------- Bug #18896: Shellwords.escape(nil) returns "empty" string https://bugs.ruby-lang.org/issues/18896 * Author: hspem (Per-Erik Martin) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [powerpc-aix7.1.0] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Mistakenly calling Shellwords.escape with nil as parameter had this result: ``` ruby irb(main):002:0> Shellwords.escape(nil) => "''" ``` This is not helpful and resulted a hard-to-find bug when a script proceeded to use an empty string where it shouldn't be possible. nil is not a string and escape should raise an exception instead. Shellwords version: ``` shell # gem list shellwords *** LOCAL GEMS *** shellwords (default: 0.1.0) # ``` -- https://bugs.ruby-lang.org/ Unsubscribe: