From: "jeremyevans0 (Jeremy Evans)" Date: 2022-05-25T19:24:19+00:00 Subject: [ruby-core:108703] [Ruby master Bug#18766] ArgumentError with no backtrace information when requiring openssl/cipher and initializing an OpenSSL::Cipher Issue #18766 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Rejected I agree that this isn't a bug. In terms of `openssl/cipher`, requiring individual parts of a library should never be assumed to be supported unless the library is explicitly designed for that. We shouldn't attempt to detect invalid requires and raise for them, in my opinion. In terms of the error message, it shows the bug comes from `#initialize`. You could argue that is confusing because you don't know which `#initialize`, but if so, that's a general Ruby issue and not related to `OpenSSL::Cipher`. If you wanted to change that, we'd need to change the default backtrace format to show which method implementation was called (the owner/defined class of the method being called). ---------------------------------------- Bug #18766: ArgumentError with no backtrace information when requiring openssl/cipher and initializing an OpenSSL::Cipher https://bugs.ruby-lang.org/issues/18766#change-97747 * Author: postmodern (Hal Brodigan) * Status: Rejected * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I discovered a mysterious ArgumentError when requiring 'openssl/cipher' instead of 'openssl' and initializing a OpenSSL::Cipher object. The ArgumentError does not indicate where the exception is being raised from. ## Steps To Reproduce ``` ruby -r openssl/cipher -e "p OpenSSL::Cipher.new('aes-256-cbc')" ``` ## Expected Result ``` # ``` ## Actual Result ``` Traceback (most recent call last): 2: from -e:1:in `
' 1: from -e:1:in `new' -e:1:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError) ``` ## Effected Versions Can reproduce this bug using ruby-2.7 and ruby-3.1. -- https://bugs.ruby-lang.org/ Unsubscribe: