OSError: [Errno 9] Bad file descriptor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.1k
- Forks
- 817
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 4
Description
Python: 3.8.10 64bit
Loguru: 0.5.3
OS: CentOS Linux release 7.9.2009 (Core)
Traceback (most recent call last):
File "/home/venv/lib/python3.8/site-packages/loguru/_handler.py", line 270, in _queued_writer
message = queue.get()
File "/usr/local/python3/lib/python3.8/multiprocessing/queues.py", line 356, in get
res = self._reader.recv_bytes()
File "/usr/local/python3/lib/python3.8/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/usr/local/python3/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
buf = self._recv(4)
File "/usr/local/python3/lib/python3.8/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
OSError: [Errno 9] Bad file descriptor
--- End of logging error ---
--- Logging error in Loguru Handler #1 ---
Record was: None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the traceback in loguru/_handler.py, especially _queued_writer, and compare it with Python 3.8's multiprocessing queue behavior on CentOS 7.9. Reproduce the bad-file-descriptor failure if possible, then identify its trigger and add regression coverage showing that queued logging does not emit this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100