From 875140296fada3659d224e3a5819ba77a81e36fe Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sat, 26 Nov 2022 15:59:20 +0100 Subject: feat(files): allow decoding project files directly to string --- docs/gl_objects/projects.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 7fc0ab9..5285c40 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -434,9 +434,12 @@ Get a file:: # get the base64 encoded content print(f.content) - # get the decoded content + # get the decoded content as bytes print(f.decode()) + # get the decoded content as a string + print(f.decode("utf-8")) + Get file details from headers, without fetching its entire content:: headers = project.files.head('README.rst', ref='main') -- cgit v1.2.1