In the last days before Pycon08 we hastily scripted support for error sharing (based on bug.gd) for use inside the Python interpreter. This is a bit of a hint of some of our long-term plans with our technology. You should give it a whirl and let us know what you think.
It’s in the Python Cheese Shop, so you can install it pretty easily:
(If you don’t have easy_install, you really should get it.)
After finishing the installation steps (it requires you to run error_help_config.py from your scripts directory), the error_help tool is now accessible from the interactive interpreter whenever you need.
Whenever you run into an exception in the interactive interpreter, you can type
error_help() and you’ll find everyone else who ran into that same error and (hopefully) how they solved it.
Here’s an example session:
>>> 0/0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: integer division or modulo by zero >>> error_help() ========== 1 of 8 ========== Error: Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: integer division or modulo by zero Solution: I divided by zero as a test. Maybe you did the same thing? The trick is not to divide by zero! ========== 2 of 8 ========== Error: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named shinynewmodule Solution: (Example error and solutions) I didn't have the shinynewmodule installed. You can install it via fake_easy_install shinynewmodule
As people use this feature, in a couple of days, they’ll receive email asking how they worked around the error. Their solution will then be visible for every future Pythonista that runs into the problem. If everyone gives back to the community, mysterious errors will be a thing of the past.
If you wanted to see some of the other results from the search, for example the 7th result, you’d just use:
Anyway, we’ve love to hear your feedback on this quick proof of concept. Keep your eye out for more “formal” versions of this feature in other applications.