Project

General

Profile

Bug #8547

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

Added by gurgeous (Adam Doppelt) over 4 years ago. Updated 7 months ago.

Status:
Third Party's Issue
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p195
Backport:
[ruby-core:55564]

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 mode_to_s, so there's no crash.

History

#1 [ruby-core:55569] Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

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

#2 [ruby-core:55570] Updated by robotmay (Robert May) over 4 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 :)

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

#3 [ruby-core:55588] Updated by nobu (Nobuyoshi Nakada) over 4 years ago

Seems there is no tests for module methods.

#4 Updated by hsbt (Hiroshi SHIBATA) about 4 years ago

  • Status changed from Open to Feedback

#5 Updated by k0kubun (Takashi Kokubun) 7 months 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 https://github.com/gurgeous/teleport/issues/22.

#6 [ruby-core:81192] Updated by wanabe (_ wanabe) 7 months ago

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

Also available in: Atom PDF