Skip to content

Commit b180baf

Browse files
fix: correct ProjectFile.decode() documentation
ProjectFile.decode() returns 'bytes' and not 'str'. Update the method's doc-string and add a type-hint. ProjectFile.decode() returns the result of a call to base64.b64decode() The docs for that function state it returns 'bytes': https://docs.python.org/3/library/base64.html#base64.b64decode Fixes: #1403
1 parent 711896f commit b180baf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitlab/v4/objects/files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
2222
_id_attr = "file_path"
2323
_short_print_attr = "file_path"
2424

25-
def decode(self):
25+
def decode(self) -> bytes:
2626
"""Returns the decoded content of the file.
2727
2828
Returns:
29-
(str): the decoded content.
29+
(bytes): the decoded content.
3030
"""
3131
return base64.b64decode(self.content)
3232

0 commit comments

Comments
 (0)