attardi / wikiextractor

A tool for extracting plain text from Wikipedia dumps
GNU Affero General Public License v3.0
3.73k stars 962 forks source link

error with" global flags not at the start of the expression at position 4" help~~~ #336

Open JoeyHuhuu opened 2 weeks ago

JoeyHuhuu commented 2 weeks ago

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "D:\Python\Lib\site-packages\wikiextractor\WikiExtractor.py", line 66, in from extract import Extractor, ignoreTag, define_template, acceptedNamespaces File "D:\Python\Lib\site-packages\wikiextractor\extract.py", line 378, in ExtLinkBracketedRegex = re.compile( ^^^^^^^^^^^ File "D:\Python\Lib\re__init__.py", line 228, in compile return _compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re__init__.py", line 307, in _compile p = _compiler.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_compiler.py", line 743, in compile p = _parser.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 972, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 855, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 855, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Lib\re_parser.py", line 833, in _parse raise source.error('global flags not at the start ' re.error: global flags not at the start of the expression at position 4

VladOnMyOwn commented 2 weeks ago

Same here

VladOnMyOwn commented 2 weeks ago

@JoeyHuhuu, try this: https://github.com/attardi/wikiextractor/pull/313/commits/ab8988ebfa9e4557411f3d4c0f4ccda139e18875 helped me

JoeyHuhuu commented 1 week ago

@JoeyHuhuu, try this: ab8988e ,请尝试以下操作: ab8988e helped me 帮助了我

thank you~