Fixes #5011
change naming test case
change mode from "r" to "r+"
Merge pull request #5594