BUG: do not stringify file-like objects
- [x] closes #38125
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I will finish this PR (fix the mypy issues) after #38018 is merged.

can you merge master as merged the PathLike change @jreback ping thanks @twoertwein  @meeseeksdev backport 1.2.x