Python2/3 compatibility for "http" service plugin
See original GitHub issueHi there,
while looking into #436, I found the http service plugin would croak on Python 3 saying Cannot GET http://example.org/: expected string or bytes-like object
:
mqttwarn --plugin=http --data='{"message": "Hello world", "addrs": ["GET", "http://example.org/", null]}'
2020-08-31 20:14:59,395 INFO [mqttwarn.commands ] Running service plugin "http" with data "{'message': 'Hello world', 'addrs': ['GET', 'http://example.org/', None]}"
2020-08-31 20:14:59,397 INFO [mqttwarn.core ] Successfully loaded service "http"
2020-08-31 20:14:59,397 DEBUG [mqttwarn.services.http ] *** MODULE=/Users/amo/dev/daq-tools/sources/mqttwarn/mqttwarn/services/http.py: service=<mqttwarn.core.Service object at 0x10a7dceb0>, target=mqttwarn, addrs=['GET', 'http://example.org/', None]
2020-08-31 20:14:59,404 WARNING [mqttwarn.services.http ] Cannot GET http://example.org/: expected string or bytes-like object
2020-08-31 20:14:59,404 INFO [mqttwarn.core ] Plugin response: False
With kind regards, Andreas.
cc @mortenf
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Conflict between Python 3 http module and http service #436
When trying to execute a service plugin file directly, as e.g. suggested by the tootpaste service ... Python2/3 compatibility for "http" service plugin...
Read more >mqttwarn - Bountysource
I'm using mqttwarn for a while now. It works great, but I'm running into an recurring issue after ~4 days of uptime. mqttwarn...
Read more >aio-service-client - PyPI
Service Client Framework powered by Python asyncio. ... Service client framework is used to call HTTP service API's. ... Python 3.9 compatible.
Read more >CHANGES — keystoneauth1 2.18.1.dev7 documentation
Add a full listing of all auth plugins and there options ... Add oslo.config compatibility attributes; Fix PyPI badges; Default for service ......
Read more >Recommended update for SUSE Manager Client Tools
Use suseLib.get_proxy to get the HTTP proxy configuration ... of source packages - Make spacewalk-backend code compatible with Python 3 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
http.py
is an absolute mess IMO. I think we should consider replacing its innards with requests. It means an additional import, but it would result in cleaner and portable code.Hi again,
the patch at #523 might resolve this problem on Python 3. Official support for Python 2 will be dropped anyway.
With kind regards, Andreas.