jams2 / py-dict-client

python 3 client for Dictionary Servers
GNU General Public License v3.0
4 stars 2 forks source link

ValueError: Client got unexpected banner in connection respons #5

Closed eking-go closed 3 years ago

eking-go commented 3 years ago

Hello.

root@home:~# dictd -V
dictd 1.12.1/rf on Linux 5.10.0-0.bpo.4-amd64
Copyright 1997-2002 Rickard E. Faith (faith@dict.org)
Copyright 2002-2007 Aleksey Cheusov (vle@gmx.net)
root@home:~# dict son
1 definition found

From English-Russian FreeDict Dictionary ver. 0.3.1 [fd-eng-rus]:

  son /sɔn/
  сын

So, dictd server works.

root@home:~# pip3 list| grep py-dict-client
py-dict-client                0.1.4

Installed the latest version of py-dict-client

root@home:~# telnet 127.0.0.1 2628
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 home.eking-go.org dictd 1.12.1/rf on Linux 5.10.0-0.bpo.4-amd64 <auth.mime> <13.11917.1618578531@home.eking-go.org>

But from python3 it does not work

>>> dc = DictionaryClient()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/dictionary_client/dictionary_client.py", line 43, in __init__
    self.server_info = self._connect(host, port)
  File "/usr/local/lib/python3.7/dist-packages/dictionary_client/dictionary_client.py", line 67, in _connect
    response = HandshakeResponse(self._recv_all())
  File "/usr/local/lib/python3.7/dist-packages/dictionary_client/response.py", line 16, in __init__
    self.content = self.parse_content()
  File "/usr/local/lib/python3.7/dist-packages/dictionary_client/response.py", line 119, in parse_content
    "Client got unexpected banner in connection response: "
ValueError: Client got unexpected banner in connection response: 220 home.eking-go.org dictd 1.12.1/rf on Linux 5.10.0-0.bpo.4-amd64 <auth.mime> <3.10523.1618577900@home.eking-go.org>
jams2 commented 3 years ago

Thanks for raising the issue, will get a fix up tonight.

jams2 commented 3 years ago

Fixed in 0.1.5: https://pypi.org/project/py-dict-client/0.1.5/