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

Unhandled Error #26

Open
engrjislam opened this issue Jan 21, 2020 · 0 comments
Open

Unhandled Error #26

engrjislam opened this issue Jan 21, 2020 · 0 comments

Comments

@engrjislam
Copy link

2020-01-21 20:47:43+0200 [Coap (UDP)] Unhandled Error
	Traceback (most recent call last):
	  File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 86, in callWithContext
	    return context.call({ILogContext: newCtx}, func, *args, **kw)
	  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	  File "/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
	    why = selectable.doRead()
	--- <exception caught here> ---
	  File "/usr/local/lib/python2.7/site-packages/twisted/internet/udp.py", line 249, in doRead
	    self.protocol.datagramReceived(data, addr)
	  File "/usr/local/lib/python2.7/site-packages/txthings/coap.py", line 790, in datagramReceived
	    message = Message.decode(data, (ip_address(host), port), self)
	  File "/usr/local/lib/python2.7/site-packages/ipaddress.py", line 165, in ip_address
	    ' a unicode object?' % address)
	ipaddress.AddressValueError: '127.0.0.1' does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object?

host into the following line needs to be converted into unicode:

File "/usr/local/lib/python2.7/site-packages/txthings/coap.py", line 790, in datagramReceived
	    message = Message.decode(data, (ip_address(host), port), self)

For example:
message = Message.decode(data, (ip_address(unicode(host)), port), self)

engrjislam added a commit to engrjislam/txThings that referenced this issue Jan 21, 2020
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