Pdb;pdb.set_trace() alternative

@idgserpro according to https://docs.plone.org/about/contributing.html#license you can add to the docs without having signed the Plone contributor agreement

E-mail sent to plone-docs@lists.sourceforge.net

@svx is the process outlined at https://docs.plone.org/about/contributing.html#license still valid?

No it is not 100% valid

there is an updated version on https://github.com/plone/documentation/blob/5.1/about/contributing.rst.

@idgserpro you're all set now, at least from our perspective. Looking forward to your pull requests :slight_smile: :slight_smile:

1 Like

We now have a new Google group / mailing list docs@plone.org that supersedes the (dead) SourceForge mailing list.

Is just me using the package https://github.com/narfdotpl/debug ?

Instead of import pdb;pdb.set_trace() you can use justa import debug.

This is also usefull to turn default Plone debug instance into a ipdb session, just need to import debug after do a ./bin/instance -O Plone debug.

3 Likes

I like turning on Products.PDBDebugMode when an exception occurs during indexing or inside some kind of loop. Otherwise, I keep it turned off (out of my sys.path), because almost always it stops execution on an Unauthorized exception or something benign and gets in my way.

otherwise, I live by set_trace()

I need to use ipdb more often, but it's not a habit yet.

It hooks into the "error_log" exception handling. If "error_log" ignores "Unauthorited", then does "PDBDebugMode".

I use https://pypi.python.org/pypi/pudb . It's an alternative to pdb with a curses interface. It's very good.

2 Likes

If nothing else helps, there is still q. See https://pypi.org/project/q/ and its lightning talk from PyCon: https://www.youtube.com/watch?v=OL3De8BAhME#t=25m15s

I like pdbpp: https://pypi.python.org/pypi/pdbpp

(will try pudb, thanks)

For debugging ZMI Python Script, you can use https://pypi.python.org/pypi/Products.enablesettrace. I just tested in a Plone 4 instance and it worked (don't know about Plone 5 though). It's really rare to need this but it's really handy.

3 Likes

Thank you @idgserpro for your great PR! (which has been merged into 5.1 docs) https://github.com/plone/documentation/pull/971

1 Like