Monday, September 11, 2023
1 change · master
New functionality added to Odoo
Odoo now supports Python's standard breakpoint feature when debugging QWeb templates. This gives developers more flexibility to use their preferred debugging tools while keeping the change internal and low impact for business users.
Original PR description
The breakpoint() builtin was added in [Python 3.7] ([PEP 553]). It is conveniently everything-agnostic, can be configured (including disabled) via an envvar (`PYTHONBREAKPOINT`) and code (`sys.breakpointhook`), and defaults to pdb (`pdb.set_trace`). This is more flexible as it allows using arbitrary callables without special casing, which mostly allows using less common debuggers (e.g. IDE debug servers / hooks). As using an empty string for the debugger name was not allowed previously, co-opt that to invoke `breakpoint`. And deprecate the old style. [Python 3.7]: https://docs.python.org/3/whatsnew/3.7.html#pep-553-built-in-breakpoint [PEP 553]: https://peps.python.org/pep-0553/