Bugs and Siegel

A couple of days ago, I ran into an obscure bug in BBEdit. It was easy to find a workaround—which was fortunate, as I was in the middle of a project for work on a tight deadline—but I didn’t want to use the workaround forever. So I dashed off a quick bug report to Bare Bones. After a few emails back and forth, I now have my own artisanal version of BBEdit1 that fixes the problem. That’s customer service!

I found the bug through yak shaving. I was writing a series of Python scripts for structural analysis using NumPy and Matplotlib. I hadn’t updated either library in quite a while and found myself wanting to use a new feature that was only available in a more recent version. So I tried to update the libraries via pip, but that led only to a long series of compiler error messages.

Screw it, I said, I’ll just install Anaconda and get up-to-date versions of a bunch of numerical and scientific libraries at once. This would mean installing an entirely new version of Python in addition to the libraries, and I’d have to do some fiddling to ensure that I always used Anaconda’s Python, but the tradeoff seemed worthwhile.

Anaconda installed itself without a hitch, and I only had to move a couple of homemade modules to its site-packages directory and add one line to my .bashrc file:

export PATH="~/anaconda/bin:$PATH"

Now the Anaconda version of Python is the one invoked when I type python or ipython at the command line or use

#!/usr/bin/env python

at the start of an executable script file.

So far, so good. But I also like to run scripts from within BBEdit using the Run command in its #! menu.

BBEdit Run command

When I tried running my scripts this way, I got a long series of error messages, starting with the

import numpy as np

line near the top of my script and finishing with a line deep within Python’s os module.

Because I was in a hurry to finish my analysis, I just ran my scripts from the Terminal, which never generated this error. I wrote a hasty bug report, sent it off to Bare Bones, and got back to work.

Patrick Woolsey, Bare Bones’s front line support guru, wrote back a couple of hours later asking for more information. He didn’t mention how poorly written my bug report had been, but I was embarrassed when I reread it—there was no way anyone could track down the bug with the information I sent in that first report. Now that I had more time, I was determined to send a more useful report.

After a bit of digging, it seemed to me that the problem lay in an environment variable set by BBEdit. The current version of the NumPy library runs os.environ.clear() when it loads, and that’s what triggered the errors I was seeing. I sent off a much longer bug report with what I’d found.

The second report got a response the following day from Rich Siegel himself. I’m sure he had better things to do than track down a bug that maybe only one of his customers had or ever would run into, but I think it got under his skin. Later that same day, he tracked it down, squashed it, and sent me a link to a rebuilt version of BBEdit to try out. It worked perfectly, and I assume the fix will be incorporated in the next release. Until then, I have my own personalized version of BBEdit.

I’ve mentioned before how nice Bare Bones was in giving me the upgrade price on BBEdit when I returned to the Mac after eight years as a Linux (and Emacs/XEmacs/NEdit) user. And they’ve always been prompt and helpful when I’ve had support questions. But this particular bug fix went above and beyond my expectations. To be sure, it was a bug and did need to be fixed, but it certainly wasn’t a showstopper and didn’t need to be fixed so quickly.

I sometimes worry about using BBEdit. What if Rich decides to retire before I become too old and feeble to write anymore? Is there someone waiting in the wings to take over, or will I have to got through the trauma of learning another text editor? Emacs users don’t have this worry about Richard Stallman, and Vim users don’t have this worry about Bram Moolenaar. Their programming is already dispersed and doesn’t rely so heavily on the original developers.

On the other hand, if I were using Emacs or Vim I’d have many more things to worry about, chief among them my sanity. ⌃x⌃c :wq!


  1. Which will soon be released to the rest of you plebs.