svinota / mdns

mDNS library
GNU General Public License v3.0
21 stars 10 forks source link

Python 3 support #9

Closed titilambert closed 10 years ago

titilambert commented 10 years ago

Hello ! I'm trying to run mdns on python3 (3.4) I get this error:

Traceback (most recent call last):
  File "/home/nemo/dev/HeySms/snipets/bad/mdns/zeroconf.py", line 1131, in run
    self.readers[socket].handle_read()
  File "/home/nemo/dev/HeySms/snipets/bad/mdns/zeroconf.py", line 1178, in handle_read
    msg = DNSIncoming(data)
  File "/home/nemo/dev/HeySms/snipets/bad/mdns/zeroconf.py", line 684, in __init__
    self.read_others()
  File "/home/nemo/dev/HeySms/snipets/bad/mdns/zeroconf.py", line 754, in read_others
    domain = self.read_name()
  File "/home/nemo/dev/HeySms/snipets/bad/mdns/zeroconf.py", line 829, in read_name
    len = ord(self.data[off])
TypeError: ord() expected string of length 1, but int found
svinota commented 10 years ago

Got it. Thanks for reporting.

svinota commented 10 years ago

Should be fixed, as well as Crypto import etc.

Actually, full integration test-cycle is planned as for pyroute2 project.

titilambert commented 10 years ago

Thanks ! BTW, i use your lib to port this app https://github.com/titilambert/HeySms on sailfish OS

svinota commented 10 years ago

Great then! Pls ping me in the case of any issues.

titilambert commented 10 years ago

Python 3 is working for me ! (tested on 3.4.1) Crypto is not mandatory any more !

Thanks !

titilambert commented 10 years ago

ReHello !

I get this error only on my sailfish device, with python 3.4.0:

>>> from mdns.zeroconf import *
>>> import socket
>>> r = Zeroconf(("192.168.2.38", ))
>>> r.cache.entries()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nemo/dev/HeySms/snipets/good/mdns/zeroconf.py", line 639, in __repr__
    return self.to_string(repr(self.text[:27] + "..."))
TypeError: can't concat bytes to str

And works with python 2.7.5

titilambert commented 10 years ago

Pull request #10 seems fix this error

svinota commented 10 years ago

Merged.

titilambert commented 10 years ago

Thanks !

I reclose it ;)