-
Notifications
You must be signed in to change notification settings - Fork 2
Description
When I run docker image according to README.md I receive this error:
/opt/coingame/asabcoin/blockchain.py:21: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
obj = yaml.load(inp)
Traceback (most recent call last):
File "coingamesvr.py", line 5, in
app = asabcoin.AsabCoinApplication()
File "/usr/lib/python3.6/site-packages/asab/abc/singleton.py", line 14, in call
cls._instances[cls] = super(Singleton, cls).call(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/asab/application.py", line 127, in init
task.result()
File "/opt/coingame/asabcoin/app.py", line 53, in initialize
'coingame': Blockchain(self, './gamecoin.yaml', difficulty=22)
File "/opt/coingame/asabcoin/blockchain.py", line 55, in init
""")
File "/opt/coingame/asabcoin/blockchain.py", line 66, in initialize
self.load()
File "/opt/coingame/asabcoin/blockchain.py", line 86, in load
bhash_obj = parse(bhash, Hash)
File "/opt/coingame/asabcoin/blockchain.py", line 21, in parse
obj = yaml.load(inp)
File "/usr/lib/python3.6/site-packages/yaml/init.py", line 114, in load
return loader.get_single_data()
File "/usr/lib/python3.6/site-packages/yaml/constructor.py", line 43, in get_single_data
return self.construct_document(node)
File "/usr/lib/python3.6/site-packages/yaml/constructor.py", line 47, in construct_document
data = self.construct_object(node)
File "/usr/lib/python3.6/site-packages/yaml/constructor.py", line 92, in construct_object
data = constructor(self, node)
File "/usr/lib/python3.6/site-packages/yaml/constructor.py", line 420, in construct_undefined
node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!Hash'
in "", line 1, column 5:
--- !Hash
^
I solved it changing line 21 in coingame/asabcoin/blockchain.py
from:
obj = yaml.load(inp)
to:
obj = yaml.load(inp, Loader=yaml.Loader)
but I'm not sure about Loader safty.