Permalink
Browse files

Workaround for lack of thread safety in zipfile

  • Loading branch information...
1 parent e44fb58 commit 65b96a476d1202f109e04a7171d7023054c93c8f @mattbasta committed Sep 6, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 validator/testcases/content.py
@@ -194,9 +194,9 @@ def map_scripts(package, scripts, err, shell):
sem = Semaphore(MAX_JS_FORKS)
- def worker(path):
+ def worker(path, data):
# Get the file data and save it.
- file_data = unicodehelper.decode(package.read(path))
+ file_data = unicodehelper.decode(data)
script_data[path]["data"] = file_data
# Get the tree data and save it.
@@ -209,7 +209,8 @@ def worker(path):
run_regex_tests(file_data, err, path, is_js=True)
for path in scripts:
- th = Thread(target=worker, args=(path, ))
+ data = package.read(path)
+ th = Thread(target=worker, args=(path, data, ))
workers.append(th)
th.start()

0 comments on commit 65b96a4

Please sign in to comment.