Bug #8547

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

Added by gurgeous (Adam Doppelt) almost 7 years ago. Updated about 3 years ago.

Third Party's Issue
Target version:
ruby -v:
ruby 2.0.0p195


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.

Related issues

Related to Backport200 - Backport #8633: backport r41853 (fix File.chmod error in :verbose mode)Closednagachika (Tomoyuki Chikanaga)07/13/2013Actions

Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago

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

Updated by robotmay (Robert May) almost 7 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 :)

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

Seems there is no tests for module methods.


Updated by hsbt (Hiroshi SHIBATA) over 6 years ago

  • Status changed from Open to Feedback

Updated by k0kubun (Takashi Kokubun) about 3 years ago

  • Backport deleted (1.9.3: DONTNEED, 2.0.0: REQUIRED)
  • Status changed from Feedback to Third Party's Issue

It seems that original issue is resolved

Updated by wanabe (_ wanabe) about 3 years ago

I guess it was fixed at r41853 before v2_1_0_preview1 and backported to ruby2_0_0 at r41946 [Backport #8633].


Updated by wanabe (_ wanabe) about 3 years ago

  • Related to Backport #8633: backport r41853 (fix File.chmod error in :verbose mode) added

Also available in: Atom PDF