def isFile(self, path=None):
# dirty hack to check where file is opened with codecs module
# (because it returns 'instance' type when encoding is specified
if path:
return isinstance(path, io.IOBase) or path.__class__.__name__ == 'StreamReaderWriter'
else:
return 'file' in self.type
评论列表
文章目录