Bug#1000732: python3-click-threading: broken monkeypatching

2021-11-28 Thread Tollef Fog Heen
]] Tollef Fog Heen 

> Versions of packages python3-click-threading depends on:
> ii  python33.9.7-1
> ii  python3-click  8.0.2-1

The problem goes away if I downgrade to python3-click 7.1.2-1, so maybe
there's a missing Breaks there too.

-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are



Bug#1000732: python3-click-threading: broken monkeypatching

2021-11-27 Thread Tollef Fog Heen
Package: python3-click-threading
Version: 0.4.4-2
Severity: serious
X-Debbugs-Cc: none, Tollef Fog Heen 

It seems like the monkeypatching in
/usr/lib/python3/dist-packages/click_threading/monkey.py is broken, at
least for me. I'm using python3-click-threading by way of vdirsyncer:

$ vdirsyncer -vdebug sync
debug: Using 1 maximal workers.
) -> None
lambda ) -> None: clear._real_click_fn() -> None)
error: Unknown error occurred: unmatched ')' (, line 1)
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/cli/__init__.py", line 
30, in inner
debug: f(*a, **kw)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/cli/__init__.py", line 
145, in sync
debug: with wq.join():
debug:   File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
debug: return next(self.gen)
debug:   File "/usr/lib/python3/dist-packages/vdirsyncer/cli/utils.py", line 
364, in join
debug: with ui_worker.patch_click():
debug:   File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
debug: return next(self.gen)
debug:   File "/usr/lib/python3/dist-packages/click_threading/__init__.py", 
line 144, in patch_click
debug: with patch_ui_functions(wrapper):
debug:   File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
debug: return next(self.gen)
debug:   File "/usr/lib/python3/dist-packages/click_threading/monkey.py", line 
50, in patch_ui_functions
debug: stub_f = eval('lambda {s}: {n}._real_click_fn({a})'

Adding a few prints shows that it's trying do do an eval of the string:

lambda ) -> None: clear._real_click_fn() -> None)

This, unsurprisingly, does not work.  I'm not sure what component has
changed in a way that breaks python3-click-threading, but the patching
seems pretty brittle.

-- System Information:

Versions of packages python3-click-threading depends on:
ii  python33.9.7-1
ii  python3-click  8.0.2-1

python3-click-threading recommends no packages.

python3-click-threading suggests no packages.

-- no debconf information

-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are