file module should check invalid arguments (fixes #2135)
Merge pull request #2294 from mmoya/bug-fixes

file module should check invalid arguments (fixes #2135)