Bug #8547

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

Added by Adam Doppelt over 2 years ago. Updated almost 2 years ago.

ruby -v:ruby 2.0.0p195 Backport:1.9.3: DONTNEED, 2.0.0: REQUIRED


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

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


#1 Updated by Tomoyuki Chikanaga over 2 years 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 over 2 years 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 :)


#3 Updated by Nobuyoshi Nakada over 2 years ago

Seems there is no tests for module methods.

#4 Updated by Hiroshi SHIBATA almost 2 years ago

  • Status changed from Open to Feedback

Also available in: Atom PDF