I use version 2.52 to extract zhwiki and all docs will rise an error.
Error occurred in both windows and Ubuntu. Python version in windows is:
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "C:\Wiki\WikiExtractor2.py", line 2565, in extract_process
e.extract(out)
File "C:\Wiki\WikiExtractor2.py", line 455, in extract
text = self.clean()
File "C:\Wiki\WikiExtractor2.py", line 570, in clean
if escape_doc:
NameError: global name 'escape_doc' is not defined
The changes is so much and I think it's too hard for me to find the bugs. I roll back to Version 2.32 and that version works.
In Version 2.39, I use 'python WikiExtractor239.py -o extracted239 zhwiki-20160305-pages-articles.xml'
and the output is NameError: global name 'templatePrefix' is not defined
INFO: Preprocessing 'zhwiki-20160305-pages-articles.xml' to collect template definitions: this may take some time.
INFO: Preprocessed 100000 pages
INFO: Preprocessed 200000 pages
INFO: Preprocessed 300000 pages
INFO: Preprocessed 400000 pages
INFO: Preprocessed 500000 pages
INFO: Preprocessed 600000 pages
INFO: Preprocessed 700000 pages
INFO: Preprocessed 800000 pages
INFO: Preprocessed 900000 pages
INFO: Preprocessed 1000000 pages
INFO: Preprocessed 1100000 pages
INFO: Preprocessed 1200000 pages
INFO: Preprocessed 1300000 pages
INFO: Preprocessed 1400000 pages
INFO: Preprocessed 1500000 pages
INFO: Preprocessed 1600000 pages
INFO: Preprocessed 1700000 pages
INFO: Preprocessed 1800000 pages
INFO: Preprocessed 1900000 pages
INFO: Preprocessed 2000000 pages
INFO: Preprocessed 2100000 pages
INFO: Preprocessed 2200000 pages
INFO: Preprocessed 2300000 pages
INFO: Preprocessed 2400000 pages
INFO: Preprocessed 2500000 pages
INFO: Preprocessed 2600000 pages
INFO: Preprocessed 2700000 pages
INFO: Loaded 868759 templates in 378.3s
INFO: Starting page extraction from zhwiki-20160305-pages-articles.xml.
INFO: Using 7 extract processes.
PPPProcess Process-2:
rocess Process-4:
rocess Process-5:
TTTraceback (most recent call last):
raceback (most recent call last):
raceback (most recent call last):
PProcess Process-6:
rocess Process-8:
rocess Process-3:
T File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
Traceback (most recent call last):
raceback (most recent call last):
T self.run()
self.run()
raceback (most recent call last):
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
P rocess Process-7:
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self.run()
T self.run()
raceback (most recent call last):
self._target(*self._args, **self._kwargs)
self._target(*self._args, **self._kwargs)
self.run()
self._target(*self._args, **self._kwargs)
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
self._target(*self._args, **self._kwargs)
self._target(*self._args, **self._kwargs)
self._target(*self._args, **self._kwargs)
self.run()
Extractor(*job[:3]).extract(out) # (id, title, page)
Extractor(*job[:3]).extract(out) # (id, title, page)
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
Extractor(*job[:3]).extract(out) # (id, title, page)
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
Extractor(*job[:3]).extract(out) # (id, title, page)
Extractor(*job[:3]).extract(out) # (id, title, page)
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
Extractor(*job[:3]).extract(out) # (id, title, page)
self._target(*self._args, **self._kwargs)
text = clean(self, text)
text = clean(self, text)
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
text = clean(self, text)
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
File "C:\Wiki\WikiExtractor239.py", line 2427, in extract_process
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
text = clean(self, text)
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
text = clean(self, text)
text = clean(self, text)
text = extractor.expandTemplates(text)
Extractor(*job[:3]).extract(out) # (id, title, page)
text = extractor.expandTemplates(text)
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
text = extractor.expandTemplates(text)
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
File "C:\Wiki\WikiExtractor239.py", line 423, in extract
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
text = extractor.expandTemplates(text)
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
text = extractor.expandTemplates(text)
text = extractor.expandTemplates(text)
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
text = clean(self, text)
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
File "C:\Wiki\WikiExtractor239.py", line 1896, in clean
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
title = fullyQualifiedTemplateTitle(title)
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
title = fullyQualifiedTemplateTitle(title)
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
text = extractor.expandTemplates(text)
res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
title = fullyQualifiedTemplateTitle(title)
File "C:\Wiki\WikiExtractor239.py", line 479, in expandTemplates
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
title = fullyQualifiedTemplateTitle(title)
return templatePrefix + ucfirst(templateTitle)
title = fullyQualifiedTemplateTitle(title)
return templatePrefix + ucfirst(templateTitle)
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
N res += wikitext[cur:s] + self.expandTemplate(wikitext[s+2:e-2])
title = fullyQualifiedTemplateTitle(title)
N File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
ameError: global name 'templatePrefix' is not defined
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
ameError: global name 'templatePrefix' is not defined
return templatePrefix + ucfirst(templateTitle)
File "C:\Wiki\WikiExtractor239.py", line 636, in expandTemplate
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
N return templatePrefix + ucfirst(templateTitle)
return templatePrefix + ucfirst(templateTitle)
ameError: global name 'templatePrefix' is not defined
N title = fullyQualifiedTemplateTitle(title)
return templatePrefix + ucfirst(templateTitle)
NameError: global name 'templatePrefix' is not defined
NameError: global name 'templatePrefix' is not defined
File "C:\Wiki\WikiExtractor239.py", line 1121, in fullyQualifiedTemplateTitle
ameError: global name 'templatePrefix' is not defined
return templatePrefix + ucfirst(templateTitle)
NameError: global name 'templatePrefix' is not defined**