S3_File.read_text
read_textencoding on_problems
Aliases: load text, open text
Documentation
Reads the whole file into a Text, with specified encoding.
Arguments
encoding: The text encoding to decode the file with. Defaults to UTF-8.on_problems: Specifies the behavior when a problem occurs during the function.
Returns
- The contents of the file as
Textdecoded with the specified encoding.
Errors
- If the bucket does not exist, an
S3_Bucket_Not_Founderror is thrown. - If the target is a directory, an
Illegal_Argumenterror is thrown. - If the file does not exist, a
File_Error.Not_Founderror is thrown. - If the access to the object is forbidden, an
S3_Error.Access_Deniederror is thrown. - If there is a problem decoding the byte stream to text, then an
Encoding_Errorwill be raised following theon_problemsbehavior.