Skip to content
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

Overzealous Filehandle Checking #9

Closed
Smylers opened this issue Jul 31, 2014 · 1 comment
Closed

Overzealous Filehandle Checking #9

Smylers opened this issue Jul 31, 2014 · 1 comment

Comments

@Smylers
Copy link

Smylers commented Jul 31, 2014

mimeinfo tries to catch people wrongly passing it a file handle rather than a file name, but in doing so it also blocks reasonable uses of supplying a file name as an object (which stringifies to the name):

$ perl -MPath::Tiny -MFile::MimeInfo -wE 'say mimetype path q[whamm.mp3]'
You should use File::MimeInfo::Magic to check open filehandles at -e line 1.

This thwarts the use of popular modules such as Path::Class and Path::Tiny, used to manipulate paths.

Please can you either remove this check (and presume the caller knows what she's doing) or refine it to let through objects that stringify. Thanks.

@mbeijen
Copy link
Owner

mbeijen commented Feb 23, 2015

Thanks for reporting.

Are you kidding me? I ♥ Path::Tiny! I use it all the time.
I guess I don't use File::MimeInfo all that often...

I removed the check you called 'overzealous' and added a unit test to make sure Path::Tiny objects are not a problem. New release will be on its way to CPAN after travis tests are OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants