The dict form of translate only works with unicodes:
>>> import string
>>> inoutdict = {ord(p):unicode(" "+p+" ") for p in string.punctuation}
>>> unicode("foo,,,bar!!1").translate(inoutdict)
u'foo , , , bar ! ! 1'
Another option is with regular expressions:
>>> import re
>>> rx = '[%s]' % re.escape(string.punctuation)
>>> re.sub(rx, r" \g<0> ", "foo,,,bar!!1")
'foo , , , bar ! ! 1'
As usual, show us a bigger picture to get better answers, e.g. why are you doing that? where does the input come from?, etc...