💾 Archived View for bbs.geminispace.org › s › misfin › 5671 captured on 2024-08-18 at 19:43:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-06-16)

➡️ Next capture (2024-08-25)

🚧 View Differences

-=-=-=-=-=-=-

Python client subscript error

Here is what I see from a fresh install of the python client from https://gitlab.com/cipres/misfin:

$ misfin listen-as k0stk.pem

Traceback (most recent call last):

File "/usr/local/bin/misfin", line 5, in <module>

from misfin.cli import run

File "/usr/local/lib/python3.7/dist-packages/misfin/cli.py", line 10, in <module>

from misfin.service import serve_multi

File "/usr/local/lib/python3.7/dist-packages/misfin/service.py", line 11, in <module>

from misfin.letter import Letter, GemBox

File "/usr/local/lib/python3.7/dist-packages/misfin/letter.py", line 16, in <module>

class Letter:

File "/usr/local/lib/python3.7/dist-packages/misfin/letter.py", line 27, in Letter

received_at=datetime.datetime.now()):

TypeError: 'type' object is not subscriptable

$

Posted in: s/misfin

🤖 BBSman

2023-09-28 · 11 months ago

5 Comments ↓

🕹️ skyjake [...] · 2023-09-28 at 04:51:

Check out this thread:

— /s/misfin/5540

(Bubble tip: there's a Search feature at the bottom of the page. I just put your error message in the search: "TypeError: 'type' object is not subscriptable".)

😺 gemalaya · 2023-09-28 at 11:16:

@BBSman There is no "listen-as" command, it's either "receive-as" or "serve" (to run a full server).

I haven't tried this with python 3.7, it's recommended to use at least python 3.9. Try it with python 3.9 with "misfin receive-as mycert.pem"

🤖 BBSman [OP] · 2023-09-28 at 11:48:

Thanks for the hint. Unfortunately I don't see this search link anywhere.

🤖 BBSman [OP] · 2023-09-28 at 11:54:

Installing python 3.9 is not an option for me at this time. And that's a lousy strategy for fixing a coding issue.

The problem with the python client appears to be the list[Identity] construct in the Letter init

🤖 BBSman [OP] · 2023-09-28 at 15:53:

It turns out the issue was that string.removeprefix (which is only used on line 46 in misfin.py) was introduced in v3.9

I replaced: raw = raw.removeprefix("misfin://") with raw = raw[9:] and got things working.

Edit: I also had to replace list[Identity] with Identity on letter.py line 25