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