diff options
author | John L. Villalovos <john@sodarock.com> | 2021-04-22 18:44:57 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-04-22 18:48:54 -0700 |
commit | b180bafdf282cd97e8f7b6767599bc42d5470bfa (patch) | |
tree | f03f73a9fac008099072f29b0b83181ca155aab7 /gitlab/v4/objects/files.py | |
parent | 711896f20ff81826c58f1f86dfb29ad860e1d52a (diff) | |
download | gitlab-b180bafdf282cd97e8f7b6767599bc42d5470bfa.tar.gz |
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
Diffstat (limited to 'gitlab/v4/objects/files.py')
-rw-r--r-- | gitlab/v4/objects/files.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index 10a1b4f..9fe692f 100644 --- a/gitlab/v4/objects/files.py +++ b/gitlab/v4/objects/files.py @@ -22,11 +22,11 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject): _id_attr = "file_path" _short_print_attr = "file_path" - def decode(self): + def decode(self) -> bytes: """Returns the decoded content of the file. Returns: - (str): the decoded content. + (bytes): the decoded content. """ return base64.b64decode(self.content) |