Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceInfo port=None not handled #1049

Open
natedogith1 opened this issue Jan 11, 2022 · 0 comments
Open

ServiceInfo port=None not handled #1049

natedogith1 opened this issue Jan 11, 2022 · 0 comments

Comments

@natedogith1
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant