question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python2/3 compatibility for "http" service plugin

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jpmenscommented, Sep 1, 2020

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.

0reactions
amotlcommented, Jun 17, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found