Explicit check for basestring type in filename.

Fixes broken 'test_quakeml.py' which passes a StringIO object to
'isFormat'.
Removing extra whitespaces.