[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3847: There is much duplication of process for choosing an encoding for Eliot messages

Tahoe-LAFS trac at tahoe-lafs.org
Mon Nov 29 15:56:57 UTC 2021


#3847: There is much duplication of process for choosing an encoding for Eliot
messages
---------------------+---------------------------
 Reporter:  exarkun  |          Owner:
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:  undecided
Component:  unknown  |        Version:  n/a
 Keywords:           |  Launchpad Bug:
---------------------+---------------------------
 * 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.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3847>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list