seemoo-lab / opendrop

An open Apple AirDrop implementation written in Python
https://owlink.org
GNU General Public License v3.0
8.49k stars 265 forks source link

TypeError: inet_aton() argument 1 must be str, not IPv4Address #36

Closed yurivict closed 4 years ago

yurivict commented 4 years ago
Traceback (most recent call last):
  File "/usr/local/bin/opendrop", line 11, in <module>
    load_entry_point('opendrop==0.10.3', 'console_scripts', 'opendrop')()
  File "/usr/local/lib/python3.6/site-packages/opendrop/cli.py", line 38, in main
    AirDropCli(sys.argv[1:])
  File "/usr/local/lib/python3.6/site-packages/opendrop/cli.py", line 77, in __init__
    self.find()
  File "/usr/local/lib/python3.6/site-packages/opendrop/cli.py", line 96, in find
    self.browser = AirDropBrowser(self.config)
  File "/usr/local/lib/python3.6/site-packages/opendrop/client.py", line 49, in __init__
    self.zeroconf = Zeroconf(interfaces=[self.ip_addr], ipv6_interface_name=config.interface)
  File "/usr/local/lib/python3.6/site-packages/opendrop/zeroconf.py", line 1779, in __init__
    socket.inet_aton(_MDNS_ADDR) + socket.inet_aton(i))
TypeError: inet_aton() argument 1 must be str, not IPv4Address
schmittner commented 4 years ago

Can you give more context?

yurivict commented 4 years ago

Doesn't this mean that socket.inet_aton(_MDNS_ADDR) needs to be socket.inet_aton(str(_MDNS_ADDR))?

schmittner commented 4 years ago

(1) _MDNS_ADDR already is a string https://github.com/seemoo-lab/opendrop/blob/10698dddff649a21daf018c9eb27bb954e16f693/opendrop/zeroconf.py#L68 (2) Your backtrace is not based on the upstream version (line numbers do not match) https://github.com/seemoo-lab/opendrop/blob/10698dddff649a21daf018c9eb27bb954e16f693/opendrop/zeroconf.py#L1779 It seems like you run a modified version?

schmittner commented 4 years ago

Closing this since the problem cannot be reproduced.