# Buggy code
def repository_archive(
    self, sha=None, streamed=False, action=None, chunk_size=1024, **kwargs
):
    """Return a tarball of the repository.

    Args:
        sha (str): ID of the commit (default branch by default)
        streamed (bool): If True the data will be processed by chunks of
            `chunk_size` and each chunk is passed to `action` for
            treatment
        action (callable): Callable responsible of dealing with chunk of
            data
        chunk_size (int): Size of each chunk
        **kwargs: Extra options to send to the server (e.g. sudo)

    Raises:
        GitlabAuthenticationError: If authentication is not correct
        GitlabListError: If the server failed to perform the request

    Returns:
        str: The binary data of the archive
    """
    path = "/projects/%s/repository/archive" % self.get_id()
    query_data = {}
    if sha:
        query_data["sha"] = sha
    result = self.manager.gitlab.http_get(
        path, query_data=query_data, streamed=streamed, **kwargs
    )
    return utils.response_content(result, streamed, action, chunk_size)


# Traceback (AttributeError)
(venv) ╭─user ~/Repositories/ExampleRepo  ‹feature/ci-ci-testing*›
╰─$ python gitlab_artifact.py                                      1 ↵
Traceback (most recent call last):
File "gitlab_artifact.py", line 60, in <module>
main()
File "gitlab_artifact.py", line 52, in main
a = most_recent_job.artifact("ExampleRepo/cached_service_specs.json")
File "/Users/lknecht/Repositories/ExampleRepo/venv/lib/python3.7/site-packages/gitlab/cli.py", line 43, in wrapped_f
return f(*args, **kwargs)
File "/Users/lknecht/Repositories/ExampleRepo/venv/lib/python3.7/site-packages/gitlab/exceptions.py", line 251, in wrapped_f
return f(*args, **kwargs)
File "/Users/lknecht/Repositories/ExampleRepo/venv/lib/python3.7/site-packages/gitlab/v4/objects.py", line 1397, in artifact
return utils.response_content(result, streamed, action, chunk_size)
File "/Users/lknecht/Repositories/ExampleRepo/venv/lib/python3.7/site-packages/gitlab/utils.py", line 28, in response_content
return response.content
AttributeError: 'list' object has no attribute 'content'

# Fixed code
def repository_archive(
    self, sha=None, streamed=False, action=None, chunk_size=1024, **kwargs
):
    """Return a tarball of the repository.

    Args:
        sha (str): ID of the commit (default branch by default)
        streamed (bool): If True the data will be processed by chunks of
            `chunk_size` and each chunk is passed to `action` for
            treatment
        action (callable): Callable responsible of dealing with chunk of
            data
        chunk_size (int): Size of each chunk
        **kwargs: Extra options to send to the server (e.g. sudo)

    Raises:
        GitlabAuthenticationError: If authentication is not correct
        GitlabListError: If the server failed to perform the request

    Returns:
        str: The binary data of the archive
    """
    path = "/projects/%s/repository/archive" % self.get_id()
    query_data = {}
    if sha:
        query_data["sha"] = sha
    result = self.manager.gitlab.http_get(
        path, query_data=query_data, raw=True, streamed=streamed, **kwargs
    )
    return utils.response_content(result, streamed, action, chunk_size)