Update file.py

fixed the Issue #7312
Merge pull request #7313 from jumping/patch-1

Update file.py