Some of my users report that the following code may raise a UnicodeDecodeError when the hostname contains non-ascii characters (however I haven't been able to replicate this on my Windows Vista machine):
self.path = path
self.lock_file = os.path.abspath(path) + ".lock"
self.hostname = socket.gethostname()
self.pid = os.getpid()
dirname = os.path.dirname(self.lock_file)
self.unique_name = os.path.join(dirname, "%s.%s" % (self.hostname, self.pid))
The last part of the traceback is:
File "taskcoachlib\thirdparty\lockfile\lockfile.pyo", line 537, in FileLock
File "taskcoachlib\thirdparty\lockfile\lockfile.pyo", line 296, in __init__
File "taskcoachlib\thirdparty\lockfile\lockfile.pyo", line 175, in __init__
File "ntpath.pyo", line 102, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcf in position 7: ordinal not in range(128)
Any ideas on why and how to prevent it?
(The exception occurs with Python 2.5 on Windows XP)