!ipquery should feed input through regex and exception parser #11

Closed
opened 2021-08-28 20:21:48 +02:00 by Georg · 2 comments
Owner

Currently if one tries to use the command with something that is not a valid IP address, or an IP address that is not contained in the cache, an ugly Python error is returned.

Currently if one tries to use the command with something that is not a valid IP address, or an IP address that is not contained in the cache, an ugly Python error is returned.
pratyush added the
Type: Feature
label 2021-08-31 15:52:02 +02:00
Author
Owner
ERROR 2021-08-31T16:19:10 Uncaught exception in ['ipquery'].
Traceback (most recent call last):
  File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/callbacks.py", line 1580, in _callCommand
    self.callCommand(command, irc, msg, *args, **kwargs)
  File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/utils/python.py", line 90, in g
    f(self, *args, **kwargs)
  File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/callbacks.py", line 1546, in callCommand
    method(irc, msg, *args, **kwargs)
  File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/commands.py", line 1116, in newf
    f(self, irc, msg, args, *state.args, **state.kwargs)
  File "/home/georg/limnoria/plugins/SnoParser/plugin.py", line 253, in ipquery
    addr = ipaddress.ip_address('xx.xx.xx.xx')
AttributeError: 'str' object has no attribute 'ip_address'
ERROR 2021-08-31T16:19:10 Exception id: 0x6c6e5


        addr = ipaddress.ip_address('xx.xx.xx.xx')
        print(addr)

but in shell

In [5]: addr = ipaddress.ip_address('xx.xx.xx.xx')

In [6]: print(addr)
xx.xx.xx.xx

@pratyush

``` ERROR 2021-08-31T16:19:10 Uncaught exception in ['ipquery']. Traceback (most recent call last): File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/callbacks.py", line 1580, in _callCommand self.callCommand(command, irc, msg, *args, **kwargs) File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/utils/python.py", line 90, in g f(self, *args, **kwargs) File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/callbacks.py", line 1546, in callCommand method(irc, msg, *args, **kwargs) File "/home/georg/limnoria/limnoria-venv/lib64/python3.8/site-packages/supybot/commands.py", line 1116, in newf f(self, irc, msg, args, *state.args, **state.kwargs) File "/home/georg/limnoria/plugins/SnoParser/plugin.py", line 253, in ipquery addr = ipaddress.ip_address('xx.xx.xx.xx') AttributeError: 'str' object has no attribute 'ip_address' ERROR 2021-08-31T16:19:10 Exception id: 0x6c6e5 addr = ipaddress.ip_address('xx.xx.xx.xx') print(addr) ``` but in shell ``` In [5]: addr = ipaddress.ip_address('xx.xx.xx.xx') In [6]: print(addr) xx.xx.xx.xx ``` @pratyush
Author
Owner

Solved 46596e0b33

Solved https://git.com.de/LimnoriaPlugins/SnoParser/commit/46596e0b33a9a5dc086028f8e0e023a4b599bc95
Georg closed this issue 2021-08-31 16:35:27 +02:00
Sign in to join this conversation.
No description provided.