Version 0.64.0 β€’ Deprecation warning for st.file_uploader decoding

Version 0.64.0


  • :bar_chart: Default matplotlib to display charts with a tight layout. To disable this,
    set bbox_inches to None, inches as a string, or a Bbox.
  • :desktop_computer: Allow fullscreen content for Streamlit Components.
  • :card_file_box: Deprecation warning for automatic decoding on st.file_uploader.
  • :see_no_evil: If gatherUserStats is False, do not even load the Segment library.
    Thanks @tanmaylaud!

Deprecation Warning: FileUploader will no longer decode files automatically beginning after August 15th.

After the initial release of the file uploader, we’ve had great feedback from the community and are undergoing a redesign. Because there is no reliable way for us to decode files with 100% accuracy, we’ve decided to separate any decoding from the file uploader API. This means that all files will be returned as a binary buffer beginning August 15th.

What can I do?

After August 15th, 2020, your application may break depending on the type of file processing being performed. We recommend taking action now to prevent any errors once the redesigned file uploader comes out.

If you are expecting a text buffer, we recommend wrapping your returned buffer in a TextIOWrapper. This will work today, and will continue to work once the file uploader API changes. To learn more about TextIOWrapper check out the python documentation.


import io
import streamlit as st

maybe_string_io = st.file_uploader(...)
# Today, maybe_string_io is either a StringIO or a BytesIO
# depending on the uploaded file.


import io
import streamlit as st

uploaded_file = st.file_uploader(...)
text_io = io.TextIOWrapper(uploaded_file)

If you are expecting uploading binary files, no action is necessary.

What if I don’t do anything?

As part of this release, st.file_uploader will now display a deprecation warning if you provide an encoding or relying on our default auto encoding. This warning can be disabled with the deprecation.showfileUploaderEncoding config option.

st.set_option('deprecation.showfileUploaderEncoding', False)

or in your .streamlit/config.toml

showfileUploaderEncoding = False

I tried to upgrade my streamlit installation (0.62.0) with the command:
pip install --upgrade streamlit.
All ok but when I run one of miy application there is an issue.
I also tried the following command: streamlit config show but there is the same issue.
Then I uninstalled and reinstalled the same version (0.64.0), but nothing has changed.
So I uninstalled the version 0.64.0 and installed the version 0.62.1.
And so everything went back to work.
I apologize for not copying the trace
Tomorrow I’ll do the operation again and copy the error.

Any ideas on how to proceed to solve the issue?

Which issue is that?
if its what i think it is try
pip3 install --upgrade protobuf


Hi @amitg1
This is the traceback:

Traceback (most recent call last):
  File "c:\users\mauro_s1nn2ps\appdata\local\programs\python\python37\lib\", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\mauro_s1nn2ps\appdata\local\programs\python\python37\lib\", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\mauro_s1nn2ps\AppData\Local\Programs\Python\Python37\Scripts\streamlit.exe\", line 4, in <module>
  File "c:\users\mauro_s1nn2ps\appdata\local\programs\python\python37\lib\site-packages\streamlit\", line 102, in <module>
    from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator
  File "c:\users\mauro_s1nn2ps\appdata\local\programs\python\python37\lib\site-packages\streamlit\", line 41, in <module>
    from streamlit.proto import Alert_pb2
  File "c:\users\mauro_s1nn2ps\appdata\local\programs\python\python37\lib\site-packages\streamlit\proto\", line 21, in <module>
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'

I see in traceback β€œprotobuf”. You are probably right.
Now I try to upgrade protobuf

Ok, with upgrade protobuf, streamlit 0.64.0 works!

Thanks @amitg1