opencensus-python icon indicating copy to clipboard operation
opencensus-python copied to clipboard

Remove custom createLock method in BaseLogHandler

Open danigm opened this issue 10 months ago • 3 comments

This patch removes the override of createLock method so this class will use the default logging.Handler method.

The tests are failing for python 3.13 because in this version there's a direct usage of self.lock instead of calling self.acquire(): https://github.com/python/cpython/blob/3.13/Lib/logging/init.py#L1025-L1026

danigm avatar Feb 06 '25 12:02 danigm

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Feb 06 '25 12:02 google-cla[bot]

To keep the current behaviour (of not synchronising handling), you instead may want to set lock to some new dummy value, which implements the threading.Lock interface. For Python 3.12 and below compatibility, you will need to implement __enter__, __exit__, acquire, release, _at_fork_reinit

EpicWink avatar Apr 30 '25 06:04 EpicWink

👍 We were affected by this, causing tests to fail at Python 3.13. I tried to add these changes to the package directly in the project, and then things works again. Any idea of when this will be officially released in the public package?