It is not really a bug, it is rather a not implemented feature.
Namely,
the plan is to make spec items symbolic objects that can be
symbolically manipulated. Currently spec items are strings
and your fix is appropriate for the moment. However, to make
the problematic line working for both cases (symbolic objects and
strings),
one can use:
shape.append(spec[1]+('-(%s)' % spec[0]))
Pearu
(I think I can look into adding symbolic support to f2py parser
within next two weeks)