I am developping a webapp in python3 in which I upload a ROOT file to be analyzed. The uploaded file is an object that effectively is a subclass of BytesIO (I do not have control on that as it comes through a file-uploader widget from the webapp framework), but when I try to open the file I got the following error:
File "/Users/sevilla/cernbox/faser/preshowerapp/root_install/lib/ROOT/_pythonization/_tfile.py", line 100, in _TFileOpen
f = klass._OriginalOpen(*args)
File "/Users/sevilla/cernbox/faser/preshowerapp/root_install/lib/ROOT/_pythonization/_tfile.py", line 100, in _TFileOpen
f = klass._OriginalOpen(*args)
File "/Users/sevilla/cernbox/faser/preshowerapp/root_install/lib/ROOT/_pythonization/_tfile.py", line 100, in _TFileOpen
f = klass._OriginalOpen(*args)
[Previous line repeated 987 more times]
RecursionError: maximum recursion depth exceeded
I was wondering whether there’s a method to open that BytesIO-like file ?
The framework for the webapp is streamlit (https://docs.streamlit.io), and I am using its file uploader widget (st.file_uploader - Streamlit Docs). I’d just like analyze the ROOT file after uploading it (so at least, being able to open it).
Please find below a MWE based on virtual environment to setup a dummy app that includes the file uploader widget:
Thanks!
It seems still a bit elaborated for a reproducer: could you put us in condition from lxplus to reproduce the problem with a file and a few python lines? Using the LCG view is of course fine.
Well, I included a MWE with just few commands, I can’t imagine what else I can do as the streamlit framework is for developping webapps, so it has to run in a browser. There’s no ‘terminal-only’ or alike other possibilities… So I guess this path is a dead-end…