Grep is your friend

by John Samuel Anderson last modified Jan 15, 2009 01:56 AM
How to find source code.

Needle in a Haystack

Sometimes, you've just got to sift through massive piles of code.  On linux, grep is amazingly useful.  (On Windows, use the File Search feature, under the Start menu.)  Here's the command to search for our strange error message: 
$ cd /var/Plone
$ grep 'Odd-length string' * -R

 Here are the results:

Binary file parts/Python-2.4.5/lib/python2.4/lib-dynload/binascii.so matches
Binary file parts/Python-2.4.5/build/lib.linux-x86_64-2.4/binascii.so matches
Binary file parts/Python-2.4.5/build/temp.linux-x86_64-2.4/binascii.o matches
parts/Python-2.4.5/Modules/binascii.c:		PyErr_SetString(PyExc_TypeError, "Odd-length string"); 

Honestly,I'm not liking these results.  It looks like our error is coming from deep in the guts of Python, which is way beyond what I want to document today.  So, let's hope we can get some better results with our pdb.set_trace().

Honest Mistake #2: I halted the grep command early, because it was taking a long time to complete.