Actions
Bug #18896
closedShellwords.escape(nil) returns "empty" string
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [powerpc-aix7.1.0]
Description
Mistakenly calling Shellwords.escape with nil as parameter had this result:
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:
# gem list shellwords
*** LOCAL GEMS ***
shellwords (default: 0.1.0)
#
Actions
Like0
Like0Like0