You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-08-16.16:31:46.696>created_at=<Date2020-08-07.15:10:00.487>labels= ['3.8', 'type-bug', 'library', '3.9', '3.10']
title='Race between setTarget and flush in logging.handlers.MemoryHandler'updated_at=<Date2020-08-16.16:31:46.696>user='https://github.com/iritkatriel'
The logging.handlers.MemoryHandler.setTarget() method does not acquire the lock, so it can change the target while flush is processing the buffer.
The script below causes flush to call target.handle when target is None, causing:
File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1265, in emit
self.flush()
File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1348, in flush
self.target.handle(record)
AttributeError: 'NoneType' object has no attribute 'handle'
New changeset 2353d77 by Irit Katriel in branch 'master': bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) 2353d77
New changeset 2c050e5 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897) 2c050e5
New changeset 08f0a21 by Miss Islington (bot) in branch '3.8':
[3.8] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21898) 08f0a21
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: