protect against loading a dir - do $dir no set $@ or $!#609
protect against loading a dir - do $dir no set $@ or $!#609mohawk2 wants to merge 1 commit intoplack:masterfrom
do $dir no set $@ or $!#609Conversation
| { | ||
| eval { Plack::Util::load_psgi("t/Plack-Util/") }; | ||
| # Perl 5.20+ gives "Did you try to load a directory", | ||
| # <=5.18 "No such file or directory" |
There was a problem hiding this comment.
I was highly surprised as well. See Travis's results on the previous version of this before I force-pushed this over the top: https://travis-ci.org/plack/Plack/builds/323431062
There was a problem hiding this comment.
I confirmed perl 5.18 reports "No such file or directory" given a directory as its argument for do. I think it's worth reporting to upstream (p5p) or make sure if this was an intentional change, since the previous behavior was more useful.
There was a problem hiding this comment.
Go ahead! In the meantime, unless there will be further releases of 5.20 etc, it seems like this is a useful change. Do you require changes?
There was a problem hiding this comment.
well since you discovered it you go ahead and report it :)
this will give the same error message for a valid perl code that failed to return from .psgi. You're right that a false value is not a right PSGI application, but the error message seems misleading to me.
There was a problem hiding this comment.
Now it will just report returned invalid value., which seems to me Ok when appended to the existing Error while loading $_file:?
|
@miyagawa Have you had a chance to review this? |
Arguably this is a shortcoming in Perl's
do. Anyway, I claim that a false$appis an invalid thing to return fromload_psgi, sodieing is always appropriate. Comments welcome!