Giter Site home page Giter Site logo

Comments (4)

martialblog avatar martialblog commented on July 27, 2024

Hi, thanks for the hint. I'll have a look at it.

Cheers, Markus

from nagios-http-json.

jdfresser avatar jdfresser commented on July 27, 2024

Thanks for your project, credits to https://stackoverflow.com/questions/40059654/python-convert-a-bytes-array-into-json-format

from nagios-http-json.

martialblog avatar martialblog commented on July 27, 2024

Hi,

is it possible you are running Python 3.5 (or older)? Because this should not be an issue with Python 3.6 and newer: https://docs.python.org/3/whatsnew/3.6.html#json

docker run -ti --rm python:3.6
Python 3.6.12 (default, Nov 18 2020, 14:46:32) 
>>> import json
>>> json.loads('{"foo": 123}')
{'foo': 123}
>>> json.loads(b'{"foo": 123}')
{'foo': 123}
docker run -ti --rm python:3.5 
Python 3.5.10 (default, Sep 10 2020, 18:30:47) 
>>> import json
>>> json.loads('{"foo": 123}')
{'foo': 123}
>>> json.loads(b'{"foo": 123}')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

Python 3.5 has reached its end-of-life, so I will update the supported versions ins the README accordingly.

from nagios-http-json.

jdfresser avatar jdfresser commented on July 27, 2024

Hello, you're right, I was running on Python 3.5, sorry for the wrong track,

from nagios-http-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.