file(self.pidfile, 'w').write('%s\n' % pid)
#except IOError, wpid_err:
except Exception, wpid_err:
sys.stderr.write(u'Error trying to write pid file to %s: %s\n' %
(unicode(self.pidfile, 'utf-8'), wpid_err))
sys.exit(1)
file(self.pidfile, 'w').write('%s\n' % pid)
#except IOError, wpid_err:
except Exception, wpid_err:
sys.stderr.write(u'Error trying to write pid file to %s: %s\n' %
(unicode(self.pidfile, 'utf-8'), wpid_err))
sys.exit(1)