You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a Server object in Python 3.6 on my Windows machine for testing, and I get a pack_into error, it seems there are 7 arguments for the 6 unsigned shorts that pack_into is expecting.
>>> server = SlimDNSServer('192.168.221.131', 'mp')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\REDACTED\slimDNS.py", line 197, in __init__
self.advertise_hostname(hostname)
File "C:\Users\REDACTED\slimDNS.py", line 226, in advertise_hostname
addr = self.resolve_mdns_address(hostname, True)
File "C:\Users\REDACTED\slimDNS.py", line 359, in resolve_mdns_address
self.handle_question(q, _answer_handler, fast)
File "C:\Users\REDACTED\slimDNS.py", line 327, in handle_question
1, 0, 1, 0, 0, 0, 0)
struct.error: pack_into expected 6 items for packing (got 7)
Oops. That's a straightforward bug. There is one too many zeros in that list. I usually only use the code to serve a responder rather than send out questions, which is why I hadn't picked that up. I will fix the code but in the mean time you can just delete the last zero on line 327.
FWIW, I just checked and it seems that the reason that I had not spotted this bug before is that the micropython implementation of struct.pack_into() ignores extra arguments.
https://github.com/nickovs/slimDNS/blob/master/slimDNS.py#L326-L327
I'm trying to create a Server object in Python 3.6 on my Windows machine for testing, and I get a
pack_into
error, it seems there are 7 arguments for the 6 unsigned shorts thatpack_into
is expecting.I'm using master at the time of this issue (https://github.com/nickovs/slimDNS/tree/aac0c2f4c60900f5e213f1002f933b3444c260c3)
The text was updated successfully, but these errors were encountered: