fluentfs.filelike.circular.text_file

fluentfs.filelike.circular.text_file(self: File, encoding: str = 'utf-8', raise_on_decode_error: bool = True) TextFile

Get a TextFile object for this file.

Note that you are responsible to ensure that the underlying file is a valid text file (since this is very expensive to ensure automatically). This function will always succeed, even if the underlying file is not a valid text file. However, when calling paths on the resulting TextFile object, errors will occur.

Parameters:

encoding – The encoding to use.

Returns:

The obtained TextFile object.