Skip to content

Error Importing Module #158

@pyrometheous

Description

@pyrometheous

I'm using PyCharm 2021.1.1 (Community Edition) with Python 3.9 on Windows 10 Version 20H2

When I try to import this module I get the following:

Traceback (most recent call last):
  File "C:\\Users\....\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 1039, in parse_template
    this = chr(ESCAPES[this][1])
KeyError: '\\s'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\....\PycharmProjects\ProjectFolder\script_name.py", line 8, in <module>
    import pythonwhois
  File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\__init__.py", line 1, in <module>
    from . import net, parse
  File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 359, in <module>
    registrant_regexes = [preprocess_regex(regex) for regex in registrant_regexes]
  File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 359, in <listcomp>
    registrant_regexes = [preprocess_regex(regex) for regex in registrant_regexes]
  File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 205, in preprocess_regex
    regex = re.sub(r"\\s\*\(\?P<([^>]+)>\.\+\)", r"\s*(?P<\1>\S.*)", regex)
  File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 327, in _subx
    template = _compile_repl(template, pattern)
  File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 318, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
  File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 1042, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions