#3847 closed defect (fixed)

There is much duplication of process for choosing an encoding for Eliot messages

Reported by: exarkun Owned by: GitHub <noreply@…>
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description

  • src/allmydata/test/init.py chooses AnyBytes?
  • src/allmydata/test/eliotutil.py chooses AnyBytes? on Python 3
  • src/allmydata/test/test_eliotutil.py chooses AnyBytes?
  • src/allmydata/util/eliotutil.py chooses AnyBytes? for real use
  • src/allmydata/util/eliotutil.py chooses AnyBytes? on Python 3 for test use

Unfortunately AnyBytes?(JSONEncoder) is not compatible with the default (EliotJSONEncoder) so wherever the choice is made inconsistently (esp between production code and the test suite) there is the opportunity for behavior skew.

Additionally, the default encoder fails for some inputs on Python 2.

AnyBytesJSONEncoder should just be used everywhere. I believe it was not used everywhere because Eliot 1.7 (the last supporting Python 2.x) did not expose the necessary pieces as parameters and so it is hard to do so.

Change History (1)

comment:1 Changed at 2021-12-01T20:47:20Z by GitHub <noreply@…>

  • Owner set to GitHub <noreply@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 8626043/trunk:

Merge pull request #1163 from tahoe-lafs/3847.eliot-anybytes-always

Use the "any bytes" encoder even on Python 2

Fixes: ticket:3847

Note: See TracTickets for help on using tickets.