Delgan / Delgan/loguru

OSError: [Errno 9] Bad file descriptor

Open
#511 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.