Using --with-followers or --with-following leads to TypeError

Last edit

Summary: Closed


< Tags: [[tag:Issue]] [[tag:Mastodon Archive]] [[tag:Open]]


> Tags: [[tag:Issue]] [[tag:Mastodon Archive]] [[tag:Closed]]

When running mastodon-archive with the switches --with-followers or --with-following, this error is displayed when attempting to save followers or following:

Traceback (most recent call last):
  File "/home/mezzo/.local/bin/mastodon-archive", line 10, in <module>
  File "/home/mezzo/.local/lib/python3.7/site-packages/mastodon_archive/", line 293, in main
  File "/home/mezzo/.local/lib/python3.7/site-packages/mastodon_archive/", line 179, in archive
    data["followers"] = followers
TypeError: 'NoneType' object does not support item assignment

It appears that lines 179 and 192 in are responsible for this error, as deleting them leads to the disappearance of the error while not impacting the tool's functionality. Please see the respective diff below:

diff --git a/mastodon_archive/ b/mastodon_archive/
index 9f90d7b..23e3d0b 100644
--- a/mastodon_archive/
+++ b/mastodon_archive/
@@ -176,7 +176,6 @@ def archive(args):
         followers = mastodon.account_followers(, limit=100)
         followers = mastodon.fetch_remaining(
             first_page = followers)
-        data["followers"] = followers
     if not with_following:
         print("Skipping following")
@@ -189,7 +188,6 @@ def archive(args):
         following = mastodon.account_following(, limit=100)
         following = mastodon.fetch_remaining(
             first_page = following)
-        data["following"] = following
     data = {
         'account': user,

Tags: Closed


Last edit

Summary: OK, applied it. Thanks!


> ----
> OK, applied it. Thanks!
> -- Alex Schroeder 2020-02-16 13:35 UTC

Hm, I think you're right. As data is set on line 194, the lines you removed are in fact optional.

– Alex Schroeder 2020-02-12 08:31 UTC

OK, applied it. Thanks!

– Alex Schroeder 2020-02-16 13:35 UTC

This wiki uses a variant of Markdown.

To save this page you must answer this question:

Please write "new issue" into the field below.