eigenmagic / fediblockhole

A tool for automatically syncing Mastodon admin domain blocks.
GNU Affero General Public License v3.0
70 stars 7 forks source link

TypeError running Fediblock #51

Closed roadriverrail closed 1 year ago

roadriverrail commented 1 year ago

Hi there!

Trying fediblockhole out, and can't get a dry run off the ground. I was following Oliphant's howto on setting this up, but I'm running into an error running this at all. Can someone point me in the right direction? This is on Python 3.8, for the record.

fediblock-sync -c /opt/fediblockhole/pull.conf.toml --dryrun

Traceback (most recent call last):
  File "/usr/local/bin/fediblock-sync", line 5, in <module>
    from fediblockhole import main
  File "/usr/local/lib/python3.8/dist-packages/fediblockhole/__init__.py", line 14, in <module>
    from .blocklists import Blocklist, parse_blocklist
  File "/usr/local/lib/python3.8/dist-packages/fediblockhole/blocklists.py", line 14, in <module>
    class Blocklist:
  File "/usr/local/lib/python3.8/dist-packages/fediblockhole/blocklists.py", line 20, in Blocklist
    blocks: dict[str, DomainBlock] = field(default_factory=dict)
TypeError: 'type' object is not subscriptable
jpwarren commented 1 year ago

Can you please share the config file you're using?

roadriverrail commented 1 year ago

Happy to. I'm attaching it here. Kindly note I had to add a ".txt" extension to it to make GitHub tolerate it. My co-admin had suggested to me that fediblockhole code looks like it has some Python 3.9-isms in it. Is it possible there's a hard requirement for Python 3.9?

pull.conf.toml.txt

mabeltron commented 1 year ago

I just came across this on Ubuntu 20.04.6 - the LTS python is 3.8. Installing 3.11 via the deadsnakes repo and creating a venv in /opt/fediblockhole for the environment has run it correctly.

roadriverrail commented 1 year ago

@mabeltron I appreciate the confirmation here. Really, the dependency on Python > 3.8 needs to be documented, enforced, or both.

Unfortunately, for the machine I'm working with, deadsnakes doesn't offer a version higher than 3.8, so I either build from source or start working on an upgrade plan.