-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, 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
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:
try:
pos = self.stream.tell()
except io.UnsupportedOperation:
# It's a FIFO or other non-seekable stream
pos = Noneor
pos = self.stream.tell() if self.stream.seekable() else NoneAlas, 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
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, 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
Status
No status