BUG: use TypeError (not OSError) when read_csv expects file path name or file-like object
The exception class was changed from `IOError` (alias of `OSError`) to `TypeError` when `read_csv` expects file path or file-like object.

This bug is split from #43366, but with more clear intent and added test.
just add this to the other PR pls