Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir.mkdir should raise TypeError if 2nd argument is not numeric #2781

Closed
djberg96 opened this issue Nov 12, 2022 · 2 comments
Closed

Dir.mkdir should raise TypeError if 2nd argument is not numeric #2781

djberg96 opened this issue Nov 12, 2022 · 2 comments

Comments

@djberg96
Copy link
Contributor

djberg96 commented Nov 12, 2022

truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]

Spotted this in berger_spec: Dir.mkdir("foo", true)

Expected: 'mkdir': no implicit conversion of true into Integer (TypeError)
Actual: method returned 0 and a directory that appears to have defaulted to 001 perms:

ls -al => d--------x 2 dberger staff 64 Nov 12 09:23 foo

It doesn't look like my shell's default umask:

>umask => 022

@andrykonchin
Copy link
Member

Thank you for reporting!

I can reproduce the issue with Boolean (true, false).

If the second argument is String, Symbol, Array, nil etc an exception is raised:

Dir.mkdir("foo", :sym)
# <internal:core> core/truffle/polyglot.rb:334:in `execute': unsupported type [:sym] (TypeError)

@andrykonchin andrykonchin self-assigned this Nov 14, 2022
@andrykonchin
Copy link
Member

Fixed in ddaa075

@andrykonchin andrykonchin added this to the 23.0.0 Release milestone Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants