In general, this is unsafe because version strings can look like this: "0.9a5".  If that happens, this line will throw an Exception.

Not sure if you want to worry about it -- the current docutils upstream doesn't tend to release non-numeric version strings (unlike, for instance, pje upstreams which uses them constantly).

Maybe the easiest thing is to try: except: here and on an exception, run the substitutions just to be safe.