chillavanilla / TeeworldsEconMod

A python script which communicates with teeworlds server log as input and econ connection as output.
MIT License
3 stars 2 forks source link

re.error: missing ), unterminated subpattern at position 0 #55

Closed ChillerDragon closed 3 years ago

ChillerDragon commented 3 years ago
[21:38:14][server]: cid=0 cmd='say "[stats] 'Dragon Loli' kills: 634 deaths: 590 killingspree: 9"'
[21:38:14][chat]: *** [stats] 'Dragon Loli' kills: 634 deaths: 590 killingspree: 9
say "[FastCap] 'Dragon Loli' 1.42 seconds faster"
[21:38:58][server]: cid=0 cmd='say "[FastCap] 'Dragon Loli' 1.42 seconds faster"'
[21:38:58][chat]: *** [FastCap] 'Dragon Loli' 1.42 seconds faster
[21:39:10][chat]: 1:0:Dragon Loli: /stats
say "[round-stats] 'Dragon Loli' kd: 0 (0/2)"
[21:39:10][server]: cid=0 cmd='say "[round-stats] 'Dragon Loli' kd: 0 (0/2)"'
[21:39:10][chat]: *** [round-stats] 'Dragon Loli' kd: 0 (0/2)
[21:39:14][chat]: 1:0:Dragon Loli: /stats
say "[round-stats] 'Dragon Loli' kd: 0 (0/2)"
[21:39:14][server]: cid=0 cmd='say "[round-stats] 'Dragon Loli' kd: 0 (0/2)"'
[21:39:14][chat]: *** [round-stats] 'Dragon Loli' kd: 0 (0/2)
[21:39:16][chat]: 1:0:Dragon Loli: /stats all
Traceback (most recent call last):
  File "./src/main.py", line 109, in <module>
    main(sys.argv[1:])
  File "./src/main.py", line 105, in main
    main_loop(_router)
  File "./src/main.py", line 35, in main_loop
    _router.handle_data(line[1:20], line[21:])  # cut off the timestamp
  File "/home/chiller/git/TeeworldsEconMod/src/router.py", line 78, in handle_data
    self.chat_controller.handle_chat_message(data)
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 207, in handle_chat_message
    player, name = self.get_rank_player(msg_normal, ": " + prefix + "stats")
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 65, in get_rank_player
    match = re.match(pattern, rankname)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "/usr/lib/python3.7/sre_parse.py", line 819, in _parse
    source.tell() - start)
re.error: missing ), unterminated subpattern at position 0
ChillerDragon commented 3 years ago
broadcast "'He-Man's killing spree with 12 kills was ended by 'zizi'"
[20:14:59][server]: cid=0 cmd='broadcast "'He-Man's killing spree with 12 kills was ended by 'zizi'"'
[20:15:06][chat]: 1:9:He-Man: I have the power !
[20:15:29][chat]: 1:7:Müsli :D: /stats skosor
Traceback (most recent call last):
  File "./src/main.py", line 109, in <module>
    main(sys.argv[1:])
  File "./src/main.py", line 105, in main
    main_loop(_router)
  File "./src/main.py", line 35, in main_loop
    _router.handle_data(line[1:20], line[21:])  # cut off the timestamp
  File "/home/chiller/git/TeeworldsEconMod/src/router.py", line 78, in handle_data
    self.chat_controller.handle_chat_message(data)
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 207, in handle_chat_message
    player, name = self.get_rank_player(msg_normal, ": " + prefix + "stats")
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 65, in get_rank_player
    match = re.match(pattern, rankname)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "/usr/lib/python3.7/sre_parse.py", line 819, in _parse
    source.tell() - start)
re.error: missing ), unterminated subpattern at position 0
ChillerDragon commented 3 years ago

Reproducible

[06:47:48][server]: cid=0 cmd='say "[stats] 'ChillerDragon' kills: 4998 deaths: 3538 killingspree: 40"'
^@^@[06:47:48][chat]: *** [stats] 'ChillerDragon' kills: 4998 deaths: 3538 killingspree: 40
^@^@[06:47:54][chat]: 1:0:ChillerDragon: /stats skosor
^@^@Traceback (most recent call last):
  File "./src/main.py", line 109, in <module>
    main(sys.argv[1:])
  File "./src/main.py", line 105, in main
    main_loop(_router)
  File "./src/main.py", line 35, in main_loop
    _router.handle_data(line[1:20], line[21:])  # cut off the timestamp
  File "/home/chiller/git/TeeworldsEconMod/src/router.py", line 78, in handle_data
    self.chat_controller.handle_chat_message(data)
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 207, in handle_chat_message
    player, name = self.get_rank_player(msg_normal, ": " + prefix + "stats")
  File "/home/chiller/git/TeeworldsEconMod/src/controllers/chat.py", line 65, in get_rank_player
    match = re.match(pattern, rankname)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "/usr/lib/python3.7/sre_parse.py", line 819, in _parse
    source.tell() - start)
re.error: missing ), unterminated subpattern at position 0