Work-arounds for steem-python problems in version 1.0.1

in #programming4 years ago

I updated my steem-python library to version 1.0.1 yesterday, and noticed that a couple things stopped working when I did.

Issue #1:

The first thing was that a number of transactions, including upvotes and claiming rewards, started failing with an error message about a missing "mode" positional parameter for new() in bip38.py. A work-around that I found for that was to change this:

 aes = AES.new(derived_half2)

to this:

aes = AES.new(derived_half2,AES.MODE_ECB)

in the file: ~/.local/lib/python3.6/site-packages/steembase/bip38.py

This is apparently fixed already in version 1.0.2, but that's not available through "pip install" yet.

Issue #2:

The second issue is that "steemtail" was failing with this message:

ValueError: nodes arg must be a comma separated string of node url's, a single string url, or a list of strings.

I worked around this by changing:

        if self._isString(nodes):
            nodes = nodes.split(',')
        elif isinstance(nodes, list):
            if not all(self._isString(node) for node in nodes):
                raise ValueError("All nodes in list must be a string.")
        else:
            raise ValueError("nodes arg must be a "
                                 "comma separated string of node url's, "
                                 "a single string url, "
                                 "or a list of strings.")

to this:

       if self._isString(nodes):
            nodes = nodes.split(',')
        elif isinstance(nodes, list):
            if not all(self._isString(node) for node in nodes):
                raise ValueError("All nodes in list must be a string.")
        else:
            if ( sys.argv[0].split("/")[-1] != "steemtail" ):
                raise ValueError("nodes arg must be a "
                                 "comma separated string of node url's, "
                                 "a single string url, "
                                 "or a list of strings.")

In the file: ~/.local/lib/python3.6/site-packages/steembase/http_client.py

This line is the only difference:

            if ( sys.argv[0].split("/")[-1] != "steemtail" ):

This does not seem to be fixed in version 1.0.2.

Not sure how to get the central repositories updated, but maybe this information will be helpful for some folks...

Sort:  

Thank you! I'm using this library this days to make a tool for Steem. I take note!

hello can you as well add #codeonsteem when ever you post something ,
i am doing this campiagn to organize developers and community members to help everyone build on and use steem .thanks
hoping for your support

Thanks for sharing!

Thank you for being awesome! You just got upvoted by the @steemingcurators. We are voting with the Steemit Community Curator @steemcurator02 account to support the best content on Steemit!

Want to participate in contests and challenges to earn more?
Follow @steemingcurators and also the official @steemitblog for info about Steemit and the Daily Diary Challenge! Share your stories on Twitter or other social media to get extra upvotes. Just comment the link in your posts!

We hope you like live music too because #musicforsteem
STEEM ON!

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 64657.99
ETH 3153.39
USDT 1.00
SBD 2.59