[issue42705] Intercepting thread lock objects not working under context managers

2021-01-17 Thread Jeremy Kloth
Change by Jeremy Kloth : -- components: -Distutils ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue42705] Intercepting thread lock objects not working under context managers

2020-12-21 Thread Mohamad Kanj
Mohamad Kanj added the comment: Thanks Raymond for the input. So with some experimentation, the __enter__() & __exit__() functions could be traceable when other kinds of objects are used with the context manager (i.e with statement using file IO or custom class objects). However, just when th

[issue42705] Intercepting thread lock objects not working under context managers

2020-12-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: The sys.setprofile() doc don't make it clear whether the __enter__ and __exit__ call were intended to be traceable events. The docs do state, "there is no way for the profiler to know about context switches between threads, so it does not make sense to u

[issue42705] Intercepting thread lock objects not working under context managers

2020-12-21 Thread Mohamad Kanj
New submission from Mohamad Kanj : The interception of Python and C functions is achieved through the `sys` module - however, when using thread locks from `threading` module for instance under context managers, the calls on the lock to `acquire()` and `release()` cannot be witnessed. If these

[issue42705] Intercepting thread lock objects not working under context managers

2020-12-21 Thread Mohamad Kanj
Change by Mohamad Kanj : -- assignee: docs@python components: C API, Demos and Tools, Distutils, Documentation files: tracing-locking-mechanisms.py nosy: docs@python, dstufft, eric.araujo, mhmdkanj priority: normal severity: normal status: open title: Intercepting thread lock objects no