Bug #8547

FileUtils.chmod("a+r", "foobar", verbose: true) crashes

Added by Adam Doppelt 10 months ago. Updated 5 months ago.

[ruby-core:55564]
Status:Feedback
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 2.0.0p195 Backport:1.9.3: DONTNEED, 2.0.0: REQUIRED

Description

To reproduce in IRB:

require "fileutils" ; FileUtils.chmod("a+r", "foobar", verbose: true)

Here's the stack:

NoMethodError: undefined method mode_to_s' for FileUtils:Module
from ~/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/fileutils.rb:970:in
chmod'

This ONLY crashes with :verbose. If you leave off :verbose it skips the call to modetos, so there's no crash.

History

#1 Updated by Tomoyuki Chikanaga 10 months ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED

#2 Updated by Robert May 10 months ago

I submitted a pull request on the GitHub mirror which fixes the issue. Whether it's the correct fix I can't be certain, as I've not submitted code to Ruby core before :)

https://github.com/ruby/ruby/pull/329

#3 Updated by Nobuyoshi Nakada 10 months ago

Seems there is no tests for module methods.

#4 Updated by Hiroshi SHIBATA 5 months ago

  • Status changed from Open to Feedback

Also available in: Atom PDF