mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-22 23:24:44 +00:00
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:
parent
bb2b227b13
commit
56b2b422a9
2 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue