From b180bafdf282cd97e8f7b6767599bc42d5470bfa Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 22 Apr 2021 18:44:57 -0700 Subject: [PATCH] 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 --- gitlab/v4/objects/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index 10a1b4f06..9fe692f5d 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) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy