-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
logging.handler fails when attempting to rotate a fifo (with potential fix) #143237
Copy link
Copy link
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
With patch e9b4ec6 (which was a fix to issues #105623 and #105887) the test for whether or not the logfile is a file comes too late for fifos.
When the rotation check in shouldRollover() happens it does a self.stream.tell() which fails if the stream is a fifo.
Since doing a filetype check on NFS is expensive (as per those bugs) I'd like to suggest either:
or
Alas, I'm not using NFS anywhere so can't quite test which would still be performant here.
I also haven't checked if this kind of fix should be done elsewhere but if the fix is fine I'm happy to put in the effort and see what I can spot. :)
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs