Fixed #23888 -- Forced File.__repr__ to return string

```py
self.assertIs(type(f.__repr__()), str)
```