- The bug manifests itself when running the app in the local machine or deployed to streamlit.app
- The app is deployed to the community cloud
a. FAILS: https://ssscore-bert.streamlit.app/ - Uses Streamlit 1.45.0
b. WORKS: https://ssscore.streamlit.app/ - Uses Streamlit 1.44.1 - Sources: GitHub - pr3d4t0r/SSScoring: Speed Skydiving Scoring - Jupyter Lab notebooks and sample data
- Full text of error
a. Local macOS terminal:
────────────────────────── Traceback (most recent call last) ───────────────────────────
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/scriptru
nner/exec_code.py:121 in exec_func_with_error_handling
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/scriptru
nner/script_runner.py:599 in code_to_exec
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/state/sa
fe_session_state.py:68 in on_script_will_rerun
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/state/se
ssion_state.py:558 in on_script_will_rerun
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/state/se
ssion_state.py:567 in _call_callbacks
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/state/se
ssion_state.py:579 in _widget_changed
in get:811
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/runtime/state/se
ssion_state.py:128 in __getitem__
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/elements/widgets
/file_uploader.py:115 in deserialize
/Users/ciurana/Python-3_13_3/lib/python3.13/site-packages/streamlit/elements/lib/fil
e_uploader_utils.py:65 in enforce_filename_restriction
────────────────────────────────────────────────────────────────────────────────────────
StreamlitAPIException: Invalid file extension: `.csv`. Allowed: ['.csv']
b. From the Streamlit.app log:
────────────────────── Traceback (most recent call last) ───────────────────────
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptru
nner/exec_code.py:121 in exec_func_with_error_handling
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptru
nner/script_runner.py:599 in code_to_exec
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/state/sa
fe_session_state.py:68 in on_script_will_rerun
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/state/se
ssion_state.py:558 in on_script_will_rerun
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/state/se
ssion_state.py:567 in _call_callbacks
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/state/se
ssion_state.py:579 in _widget_changed
in get:807
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/state/se
ssion_state.py:128 in __getitem__
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/elements/widgets
/file_uploader.py:115 in deserialize
/home/adminuser/venv/lib/python3.12/site-packages/streamlit/elements/lib/fil
e_uploader_utils.py:65 in enforce_filename_restriction
────────────────────────────────────────────────────────────────────────────────
StreamlitAPIException: Invalid file extension: `.csv`. Allowed: ['.csv']
- Versions:
a. FAILS (Streamlit.app): Python 3.12.10, Streamlit 1.45.0
b. FAILS (local): Python 3.13.3, Streamlit 1.45.0
c. WORKS (Streamlit.app): Python 3.12.10, Streamlit 1.44.1
d. WORKS (local): Python 3.13.3, Streamlit 1.44.1
Link to the only place in the code that uses st.file_uploader()
: SSScoring/ssscoring/appcommon.py at 38b44b3f1c1afffdb9da43d61cdcbb8050ae3df0 · pr3d4t0r/SSScoring · GitHub
if singleTrack:
trackFile = st.sidebar.file_uploader('Track file', [ 'CSV', 'csv', ], disabled=st.session_state.elevation == None, key = st.session_state.uploaderKey)
if trackFile:
st.session_state.trackFile = trackFile
else:
trackFiles = st.sidebar.file_uploader(
'Track files',
[ 'CSV', 'csv', ],
disabled=st.session_state.elevation == None,
accept_multiple_files=True,
key = st.session_state.uploaderKey
)
Steps to recreate
- Load SSScore 2.4.6 (see link in item 2a)
- Set the elevation to 19.0
- Upload the
test-data-00.CSV
file - Crash after upload
Workaround
Follow the same steps, but use SSScore 2.4.5 (link in item 2b), that uses Streamlit 1.44.1 instead of 1.45.0. The code internals are the same.