adamchainz / django-rich

Extensions for using Rich with Django.
MIT License
121 stars 10 forks source link

console.status and breakpoint #190

Closed eduzen closed 6 months ago

eduzen commented 6 months ago

Python Version

3.12

Django Version

5.0

Package Version

1.8.0

Description

Sorry for bug you @adamchainz When I'm using the example from the documentation with self.console.status("Starting...") as status: and I write a breakpoint() I can not debug properly. The status.update(f"Processing {count}...") interfere with the ipdb> and I can not see what I write. I commented the context manager and status for debugging, and problem gone, but I thought it was nice to write the pain in an issue. I would like to help more with the issue! Have a good day!

image

adamchainz commented 6 months ago

This is a Rich issue rather than a django-rich one, really. Any fix would need to be upstream. I searched the Rich issue tracker and found: https://github.com/Textualize/rich/issues/1053 . The final comment suggests using a pipe, I tried:

./manage.py example | cat

And that worked for me, disabling the Rich progress stuff and allowing the debugger to work.

eduzen commented 6 months ago

Thank you @adamchainz