<@U051221NF> Did we lose the ability to close the ...
# development
w
@happy-kitchen-89482 Did we lose the ability to close the IO off https://github.com/pantsbuild/pants/pull/22745?
h
That code is for reading/writing to Python's stdout/stderr/stdin from Rust, I'm not sure how closing enters into it?
w
Seeing this error after some failures in CI - not sure if it's from before or after.
Copy code
Exception ignored while finalizing file <_io.TextIOWrapper encoding='UTF-8'>:
Traceback (most recent call last):
  File "/home/runner/work/pants/pants/src/python/pants/init/logging.py", line 227, in initialize_stdio_raw
    sys.__stdin__, sys.__stdout__, sys.__stderr__ = sys.stdin, sys.stdout, sys.stderr  # type: ignore[misc,assignment]
AttributeError: 'builtins.PyStdioRead' object has no attribute 'close'
Exception ignored while finalizing file <_io.BufferedReader>:
Traceback (most recent call last):
  File "/home/runner/work/pants/pants/src/python/pants/init/logging.py", line 227, in initialize_stdio_raw
    sys.__stdin__, sys.__stdout__, sys.__stderr__ = sys.stdin, sys.stdout, sys.stderr  # type: ignore[misc,assignment]
AttributeError: 'builtins.PyStdioRead' object has no attribute 'close'
I just saw you removed a drop, and that we don't close files - we abandon handles. I couldn't see anything related to closing specifically, but wasn't sure if that was built into the unix rawfd
Should note, this isn't the cause of any crashes - just that when some of the logging hits it's try/except/finally block I see this
h
Oh,
Console.drop()
was superseded by
FileAndCFd.drop()
which does the same thing