Is ' allowed in streamlit when accessing dict in python?

Summary

I am checking this one app after 1 year of not using it. It was working fine before. I updated requirements.txt to latest version.

Steps to reproduce

Code snippet:

This is code that is failing

number_of_symbols = len([s for s in exchange_info['symbols']])

# with error
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
File "/app/crypto-move/index.py", line 149, in <module>
    number_of_symbols = len([s for s in exchange_info['symbols']])

I do not understand why, exchange_info is just dict, it was working fine before and eve now it is working locally.

Expected behavior:

no error

Actual behavior:

error

Debug info

  • Streamlit version: streamlit==1.23.1
  • Python version: 3.9.2
  • Using: PipEnv
  • OS version: localy on OSX 10.15 is fine, problem on streamlit
  • Browser version: Chrome 114.0.5735.106 (Official Build) (x86_64)

Requirements file

Links

Additional information

only on streamlit

I have found what is problem by debugging response in exchange_info

exchange_info {'code': 0, 'msg': "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error."}

look like you can not access www.binance.com from streamlit IP address.

this explains why it was working 1 year ago.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.