cleo icon indicating copy to clipboard operation
cleo copied to clipboard

Formatter's `is_decorated` property is temporarily disabled during `remove_format` breaking concurrent threads

Open vfazio opened this issue 10 months ago • 1 comments

See https://github.com/python-poetry/poetry/issues/9334

Poetry relies on the formatter's is_decorated property to be consistent when multiple threads query the property.

If one thread is in the middle of updating a section and has changed the formatter's is_decorated property via remove_format, a second thread may query it and get back an incorrect result.

If cleo is not thread-safe, the developers of poetry should be made aware, otherwise there may need to be changes to how remove_format and format work in relation to whether decorated output is supported in general vs decorated output is being emitted for the current format operation.

vfazio avatar Apr 28 '24 17:04 vfazio