python-nostr icon indicating copy to clipboard operation
python-nostr copied to clipboard

Publish to relays fails with TypeError (python3.11.4, nostr 0.0.2)

Open escapedcat opened this issue 2 years ago • 5 comments

Trying the current "Publish to relays" example I get

event = Event("Hello Nostr")
^^^^^^^^^^^^^^^^^^^^
TypeError: Event.__init__() missing 1 required positional argument: 'content'

Not sure what's missing.

Using

  • nostr 0.0.2
  • Python 3.11

The old example with version 0.0.1 and Pyhton 3.10.9 still works. Rolling back for now.

escapedcat avatar Mar 07 '23 10:03 escapedcat

If I remember correctly, you need to use like this Event(publickey="", content="")

bbgx avatar Mar 07 '23 18:03 bbgx

Hm, yes, with 0.0.1 it works like that.

The README example was changed here: https://github.com/jeffthibault/python-nostr/commit/69ff17b163f8af40f9514bcf7937964cb22997a2#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R53 Trying the current example doesn't work for me.

escapedcat avatar Mar 08 '23 12:03 escapedcat

I have the same problem...

Stosso avatar Apr 18 '23 15:04 Stosso

the readme is still incorrect... "publish to relays" section

decentropy avatar Jul 03 '23 21:07 decentropy

After the current "Python 3.10.9 / nostr 0.0.1"-setup started to fail as well I switched to Calles fork as well and everything works fine again.

escapedcat avatar Jul 13 '23 06:07 escapedcat