Handle file-like objects with no ._name

e.g. from StringIO