Page MenuHomePhabricator

Move threading.RLock to backports module
Closed, ResolvedPublic

Description

Move threading.RLock to backports module

Reason:
pywikibot.threading.RLock was introduced with T151727 to implement compat's output cache. The only reason for this derived class was to have a locked() method which is used in terminal_interface_base.UI. With Python 3.14 this locked() method was implemented. The additional count property isn't used within the framework and can surely dropped if we went back to the standard Python implementation.

Steps

  • move pywikibot.threading.RLock to backports module and implement it for Python < 3.13
  • deprecate pywikibot.threading.RLock
  • deprecate (or remove) count property

Details

Related Objects

Event Timeline

Xqt changed the task status from Open to In Progress.May 24 2025, 10:49 AM
Xqt triaged this task as Low priority.
Xqt moved this task from Backlog to Backwards compatibility on the Pywikibot board.

Change #1149817 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] IMPR: move tools.threading.RLock to backports module

https://gerrit.wikimedia.org/r/1149817

Change #1149817 merged by jenkins-bot:

[pywikibot/core@master] IMPR: move tools.threading.RLock to backports module

https://gerrit.wikimedia.org/r/1149817