ensure that thread name is ascii

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2718 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2005-07-05 22:06:18 +00:00
parent bb2b227b13
commit 56b2b422a9
2 changed files with 4 additions and 0 deletions

View file

@ -103,6 +103,7 @@ class Consumer (object):
This method is not thread safe (hence it should only be called
from a single thread).
"""
name = linkcheck.strformat.ascii_safe(name)
self._threader.start_thread(url_data.check, (), name=name)
@synchronized(_lock)

View file

@ -133,6 +133,9 @@ class Threader (object):
func(*args)
else:
self._acquire()
# thread names must be ASCII to avoid conversion problems
assert isinstance(name, str) or name is None, \
"Invalid name %r" % name
t = threading.Thread(None, func, name, args)
t.start()
self.threads.append(t)