Skip to content

File.stat("someunavailable").mtime returns odd result #3448

@slackfan

Description

@slackfan

Hi,

path = 'bananarama'
mtime = path && File.stat(path).mtime rescue nil
puts mtime
puts mtime.class

In JRuby-9.0.1.0 the result is what I would expect


NilClass

In JRuby-9.0.3.0 the result is a "random (?)" date in the future

2016-02-11 18:23:35 +0100
Time

This breaks e.g. Rubygems because the check for a newer gem on the gem server fails because an unavailable gem is recognized as newer than the gem on the gem server. (RemoteFetcher.cache_update_path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions