SyntaxFix
Write A Post
Hire A Developer
Questions
Why not just wrap the "osopen" with a try/except and let the underlying OS sort out whether the file is valid?
This seems like much less work and is valid no matter which OS you use.