Repository navigation
ServiceInfo port=None not handled #1049
Copy link
Copy link
Open
Description
You get an error when you try to register a ServiceInfo with the default port.
>>> zc.register_service(zeroconf.ServiceInfo("_test._tcp.local.", "test._test._tcp.local."))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_core.py", line 574, in register_service
run_coro_with_timeout(
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_utils\asyncio.py", line 97, in run_coro_with_timeout
return asyncio.run_coroutine_threadsafe(aw, loop).result(
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 440, in result
return self.__get_result()
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 389, in __get_result
raise self._exception
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_utils\asyncio.py", line 82, in await_awaitable
await task
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_core.py", line 638, in _async_broadcast_service
self.async_send(self.generate_service_broadcast(info, ttl, broadcast_addresses))
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_core.py", line 889, in async_send
log_debug = log.isEnabledFor(logging.DEBUG)
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_protocol\outgoing.py", line 398, in packets
answers_written = self._write_answers_from_offset(answer_offset)
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_protocol\outgoing.py", line 334, in _write_answers_from_offset
if not self._write_record(answer, time_):
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_protocol\outgoing.py", line 298, in _write_record
record.write(self)
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_dns.py", line 429, in write
out.write_short(self.port)
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_protocol\outgoing.py", line 201, in write_short
self._pack(b'!H', 2, value)
File "C:\Users\natedogith1\AppData\Local\Programs\Python\Python39\lib\site-packages\zeroconf\_protocol\outgoing.py", line 184, in _pack
self.data.append(struct.pack(format_, value))
struct.error: required argument is not an integer
Metadata
Metadata
Assignees
Labels
No labels
Activity