ashb commented on issue #14924:
URL: https://github.com/apache/airflow/issues/14924#issuecomment-912562519
So I _think_ that the file handler will be closed by the GC finalizer (and
since Python uses both ref counting and a period GC to detect loops) assigning
`self.handler` to something else should GC the old handler and old FH.
_Should_. But it is entirely possible that the logging framework might have
another reference to it somewhere hanging around.
```
In [2]: x = {'y': open("/etc/passwd")}
```
```
lrwx------ ash ash 64 B Fri Sep 3 14:48:12 2021 0 ⇒ /dev/pts/3
lr-x------ ash ash 64 B Fri Sep 3 14:49:06 2021 12 ⇒ /etc/passwd
```
```
x['y'] = open("/etc/group")
```
```
lrwx------ ash ash 64 B Fri Sep 3 14:48:12 2021 0 ⇒ /dev/pts/3
lr-x------ ash ash 64 B Fri Sep 3 14:49:26 2021 13 ⇒ /etc/group
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]