diff --git a/gitlab/client.py b/gitlab/client.py index 7927b3f6f..3f28eb956 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -505,6 +505,12 @@ def http_request( json = None if post_data is None: post_data = {} + else: + # booleans does not exists for data (neither for MultipartEncoder): + # cast to string int to avoid: 'bool' object has no attribute 'encode' + for k, v in post_data.items(): + if isinstance(v, bool): + post_data[k] = str(int(v)) post_data["file"] = files.get("file") post_data["avatar"] = files.get("avatar") data = MultipartEncoder(post_data)