Python tests fail with "ValueError: Invalid file object: <_io.BufferedReader name=20>"
Changes to code that is unrelated to Python and Python tests leads to error like
DUNE-INFO: Compiling HierarchicalGrid (new)
Traceback (most recent call last):
File "test_gf1.py", line 56, in <module>
gridView = structuredGrid([0,0],[1,1],[10,10])
File "/builds/core/dune-grid/build-cmake/python/dune/grid/core.py", line 52, in structuredGrid
return yaspGrid(domain, dimgrid=len(lower))
File "/builds/core/dune-grid/build-cmake/python/dune/grid/_grids.py", line 38, in yaspGrid
gridModule = module(includes, typeName, ctor)
File "/builds/core/dune-grid/build-cmake/python/dune/grid/grid_generator.py", line 348, in module
module = generator.load(includes, typeName, typeHash, *args, **kwargs)
File "/duneci/modules/dune-common/build-cmake/python/dune/generator/generator.py", line 169, in load
return self.post(moduleName, source, postscript, extraCMake)
File "/duneci/modules/dune-common/build-cmake/python/dune/generator/generator.py", line 121, in post
module = builder.load(moduleName, source, self.typeName[0], extraCMake)
File "/duneci/modules/dune-common/build-cmake/python/dune/generator/cmakebuilder.py", line 341, in load
self.compile(infoTxt=PrintCompiling, target=moduleName)
File "/duneci/modules/dune-common/build-cmake/python/dune/generator/cmakebuilder.py", line 237, in compile
logLevel=logging.INFO
File "/duneci/modules/dune-common/build-cmake/python/dune/generator/cmakebuilder.py", line 215, in callCMake
_, stderr = cmake.communicate()
File "/usr/lib/python3.7/subprocess.py", line 939, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.7/subprocess.py", line 1672, in _communicate
selector.register(self.stdout, selectors.EVENT_READ)
File "/usr/lib/python3.7/selectors.py", line 352, in register
key = super().register(fileobj, events, data)
File "/usr/lib/python3.7/selectors.py", line 238, in register
key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)
File "/usr/lib/python3.7/selectors.py", line 225, in _fileobj_lookup
return _fileobj_to_fd(fileobj)
File "/usr/lib/python3.7/selectors.py", line 40, in _fileobj_to_fd
"{!r}".format(fileobj)) from None
ValueError: Invalid file object: <_io.BufferedReader name=20>
This happens at least for dune-grid and dune-functions, see for example dune-grid!571 (merged)