OGR CreateLayer returns TypeError

As it turns out, creating a layer name on an ESRI shapefile can't be done using a unicode string. Since way back in my file system, I was dynamically pulling layer names from a set of file names, I was allowing for unicode, but it is unsupported with that CreateLayer(). The issue was (sort of fixed) by doing the following:

layer_name = layer_name.encode('utf-8')
layer = ds.CreateLayer(layer_name, spat_ref, ogr.wkbPolygon)

Now it runs just fine, though with a slightly smaller potential character set.