holgern/beem

[Beem] [Version: 0.20.20] While trying to read Comment/Post creation time, beem throws an ValueError

sourovafrin opened this issue · 2 comments

Expected behavior

from beem.comment import Comment
from beem.steem import Steem
stm=Steem()
c = Comment("@azizbd/ktblk-monthly-food-gifts-for-underprivileged-families",stm)
post_date = c["created"]
print(post_date)

This should return the post date of that specified post

Actual behavior

getting below a error while trying to do this:

vote[p] = int(vote.get(p, "0"))
ValueError: invalid literal for int() with base 10: '39.68'

How to reproduce

from beem.comment import Comment
from beem.steem import Steem
stm=Steem()
c = Comment("@azizbd/ktblk-monthly-food-gifts-for-underprivileged-families",stm)
post_date = c["created"]
print(post_date)
  • Install latest version of beem and run this code.

  • Run the upper codes, it will throw the mentioned error.

  • You can use any other permlink as well

Possible fix

I have created a PR #174. Implementing this, solved the issue for me

Recording Of The Bug

https://youtu.be/VY25NonX3kg

  • Python 3.6

  • Beem version 0.20.20

  • Operating system: Ubuntu 18.06

I believe this is a node issue. The value '39.68' that's tried to get parsed as int is the reputation, which is returned by the steemit/hivemind node in the normalized format instead of the raw format like all other nodes. Allowing this value to be parsed as float possibly breaks reputation-related values/calculations for comments.

Thanks for the report,
This is a node problem, but I fixed the comment object so that it will not break, when similar problems reapear.
Fixed in 2311872#diff-0f7dc83e2e0cdd9d343c46de9a1437cb