diff --git a/Lib/mimetools.py b/Lib/mimetools.py index da33a7777b9..baf9379f537 100644 --- a/Lib/mimetools.py +++ b/Lib/mimetools.py @@ -106,8 +106,14 @@ def choose_boundary(): import socket import os hostid = socket.gethostbyname(socket.gethostname()) - uid = `os.getuid()` - pid = `os.getpid()` + try: + uid = `os.getuid()` + except: + uid = '1' + try: + pid = `os.getpid()` + except: + pid = '1' seed = `rand.rand()` _prefix = hostid + '.' + uid + '.' + pid timestamp = `int(time.time())`