Fix bad file mode string, Fix #7958