Fix file opening in python bindings.

This corrects an issue introduced in 8fe38245 where the alternate input
to ftopen() was not accepted as the regular expression match would error
instead of simply failing.