Error on send message via API #1898
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you send a message to an address registered in the address book via API, an error will be returned.
OS: Windows 10 21H1
PyBitmessage: 0.6.3.2 20211207
Could I see your code?
The first thing you can prepare is written in C, is that okay?
I'm not afraid (;
The line number of your traceback seems to point to decoding of base64 in subject argument
https://github.com/teruteru128/study/blob/develop/src/bmsendmsg.c
https://github.com/teruteru128/libstudy/blob/master/src/bmapi.c
Hmm ... should I submit something made with python?
I think it's probably not difficult because it depends on whether there is a corresponding record in the address book using the XML-RPC API.
Oh, I see it's really about the label: https://github.com/Bitmessage/PyBitmessage/blob/v0.6/src/api.py#L1137
Yes, if you can reproduce it in python. Don't you get this exception when using JSON-RPC? It seems not related.
Perhaps try to remove the comma in the line. Does it help?
Пт, 10 груд. 2021 20:23 користувач Teruteru @.***> пише:
Um ... I'm sorry, I'm using PyBitmessage distributed as a binary on Windows, so I can't modify the source code and test it right away.
However, the indication of removing the comma seems correct.
OK, so I have to write a test and merge the fix or at least build a new
continuous release. Maybe tomorrow.
Пт, 10 груд. 2021 20:46 користувач Teruteru @.***> пише:
The source code has been updated. I think this makes it easier to see.
https://github.com/teruteru128/study/blob/9324573/src/bmsendmsg.c
https://github.com/teruteru128/libstudy/blob/d3475a2/src/bmapi.c#L88-L126
The
ValueError
is confusing me. However I was able to reproduce a scaled down version of the exception, maybe it will help (I don't have more time at the moment to look into it).If I had to take a wild guess, I would say there are duplicate records in the address book, or the
label
column is stored in an unusual storage type (aBLOB
instead of aTEXT
, maybe). This type of problem should still be handled better in PyBM though.Try bytes:
toLabel = b'test'
Сб, 11 груд. 2021 03:20 користувач Peter Šurda @.***>
пише:
Yep looks like you're right:
Well the same happens with a string, makes sense for python2. So the comma shouldn't be there, it's a bug.
The test is written, the fix is already available on my continuous release page. Note, it's built in slightly different way than official ones.
I was able to confirm that the problem was fixed! 👍
So, let's wait for merging of #1899. Thank you for report! It's been a while since the API refactoring.
@g1itch
Hi, I've tried this unofficial release, but it doesn't seem that jsonapi is available. Should I create a new issue?
I have confirmed that the same issue occurs with the officially released snapshot binaries.
https://download.bitmessage.org/snapshots/20211207/
Thank you I'll open a separate issue for this.