UnsupportedOperation: stdout_redirected bug when run in Spyder or Jupyter
Created originally on Bitbucket by avmo (Ashwin Vishnu)
Could be Python 3.6+ specific.
Traceback (most recent call last):
File "<ipython-input-6-9de0f7678587>", line 1, in <module>
runfile('/afs/mech.kth.se/home/mech/avmo/src/latex/augier_vishnu_lindborg_sw1l/Python/make_fig_Emean_time.py', wdir='/afs/mech.kth.se/home/mech/avmo/src/latex/augier_vishnu_lindborg_sw1l/Python')
File "/scratch/avmo/miniconda3/envs/fluidmeta/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 668, in runfile
execfile(filename, namespace)
File "/scratch/avmo/miniconda3/envs/fluidmeta/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/afs/mech.kth.se/home/mech/avmo/src/latex/augier_vishnu_lindborg_sw1l/Python/make_fig_Emean_time.py", line 110, in <module>
fig1_plot_all(paths_sim)
File "/afs/mech.kth.se/home/mech/avmo/src/latex/augier_vishnu_lindborg_sw1l/Python/make_fig_Emean_time.py", line 48, in fig1_plot_all
fig1_energy(paths, fig, ax, legend=legend, t_start=30., linestyle=style)
File "/afs/mech.kth.se/home/mech/avmo/src/latex/augier_vishnu_lindborg_sw1l/Python/make_fig_Emean_time.py", line 61, in fig1_energy
with stdout_redirected():
File "/scratch/avmo/miniconda3/envs/fluidmeta/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/scratch/avmo/src/fluidmeta/fluiddyn/fluiddyn/io/redirect_stdout.py", line 51, in stdout_redirected
stdout_fd = fileno(stdout)
File "/scratch/avmo/src/fluidmeta/fluiddyn/fluiddyn/io/redirect_stdout.py", line 18, in fileno
fd = getattr(file_or_fd, "fileno", lambda: file_or_fd)()
UnsupportedOperation: fileno