#1061303 json2bson: AttributeError: 'NoneType' object has no attribute 'encode'

#1061303#3
Date:
2024-01-22 13:06:00 UTC
From:
To:
I ran into this:

    $ echo '{}' | json2bson > /dev/null
    Traceback (most recent call last):
      File "/usr/bin/json2bson", line 88, in <module>
        fh_dumpers[otype](data, ofh)
      File "/usr/bin/json2bson", line 39, in <lambda>
        "bson": lambda arg, fh: fh.write(bson.encode(arg)),
                                         ^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'encode'

Apparently that's because I didn't have python3-bson installed, but the
error message didn't give me any clue about what's wrong.