Project

General

Profile

Feature #13613

Prefer that require/require_relative/load to tell us permission error if the target file is unreadable

Added by sonots (Naotoshi Seo) over 3 years ago. Updated about 3 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:81467]

Description

Background

https://github.com/google/google-api-ruby-client/issues/205

We've ever met a situation that read-permissions of files in released google-api-client gem were lost as:

$ ls -l ~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/google-api-client-0.8.3/lib/google
-rw-r----- 1 sonots sonots 27249  March 24 18:32 2015 api_client.rb

The error message was

in `require': cannot load such file -- api_client.rb (LoadError)

At that time, it took 30 minutes for me to find the reason why we get LoadError with the gem because the file exists.
I looked the source codes load.c, and finally I found the reason as it is because of permission with my intuition.

What I Want

If require tells us PermissionError in addition to LoadError, I could figure out the reason soon.
I think the additional information is helpful for finding such issues.


Related issues

Related to Ruby master - Feature #5980: Trying to Load File When Too Many Files Open Should Raise Something Other Than Plain LoadErrorRejectedActions

Also available in: Atom PDF