steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
153 stars 98 forks source link

incorrect handling of list and set breaks Post #243

Open john-g-g opened 6 years ago

john-g-g commented 6 years ago

Version of Python you are running

3.6.4

Version of steem-python you are running

1.0.1

Expected Behavior

op = {'block': 23035025,
 'op': ['comment',
  {'author': 'badcontent',
   'body': '**This user is on the @buildawhale blacklist for one or more of the following reasons:**\n\n* Spam\n* Plagiarism\n* Scam or Fraud\n',
   'json_metadata': '',
   'parent_author': 'sdavignon',
   'parent_permlink': '20180604t190002479z',
   'permlink': 're-20180604t190002479z-20180604t190056',
   'title': ''}],
 'op_in_trx': 0,
 'timestamp': '2018-06-04T19:00:57',
 'trx_id': 'e3d654d5a1a09a5cf6fc0021e6d8fa5c0ff983af',
 'trx_in_block': 17,
 'virtual_op': 0}

parent_id = '@sdavignon/20180604t190002479z'
post = steem.post.Post(parent_id)

Actual Behavior

Traceback (most recent call last):
  File "/Users/muyloco/Dev/steemit/yo/.venv/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-18-b4e569f2be0a>", line 1, in <module>
    steem.post.Post(parent_id)
  File "/Users/muyloco/Dev/steemit/yo/.venv/lib/python3.6/site-packages/steem/post.py", line 57, in __init__
    self.refresh()
  File "/Users/muyloco/Dev/steemit/yo/.venv/lib/python3.6/site-packages/steem/post.py", line 104, in refresh
    post["tags"] = set(tags)
TypeError: unhashable type: 'list'

Steps to reproduce

Stack Trace