-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an error when using include_dependency with non-existent file #52105
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1721,6 +1721,7 @@ function _include_dependency(mod::Module, _path::AbstractString; track_content=t | |||||||
push!(_require_dependencies, | ||||||||
(mod, path, filesize(path), open(_crc32c, path, "r"), -1.0)) | ||||||||
else | ||||||||
@assert ispath(path) "'$path': No such file or directory" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(It has to be a readable file — not just a path, e.g. not a directory — for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The perm check should be moved to the other branch, because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #51798 is concerned with the other branch. If the file does not exist there, then the error is thrown through |
||||||||
push!(_require_dependencies, | ||||||||
(mod, path, UInt64(0), UInt32(0), mtime(path))) | ||||||||
end | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good but assert is the wrong choice here. Just check and throw a meaningful error type