Original report by me.
I am currently debugging a problem in glotzformats where the gtar file reader is misbehaving, when one frame has a type_shapes.json file but another frame does not.
I've traced it back to a behavior in libgetar that I find unusual. When readBytes is called on a nonexistent path, like traj.readBytes('potato'), it returns None. When getRecord is called on a nonexistent path, like traj.getRecord(gtar.Record('potato')), it returns an empty string.
My expectation was that both of these would raise a KeyError. It's not clear what use case the current behavior is enabling / preserving. The behavior of getRecord in particular is non-obvious, and caused JSON decoding errors when trying to decipher an empty string.
Original report by me.
I am currently debugging a problem in glotzformats where the gtar file reader is misbehaving, when one frame has a
type_shapes.jsonfile but another frame does not.I've traced it back to a behavior in
libgetarthat I find unusual. WhenreadBytesis called on a nonexistent path, liketraj.readBytes('potato'), it returnsNone. WhengetRecordis called on a nonexistent path, liketraj.getRecord(gtar.Record('potato')), it returns an empty string.My expectation was that both of these would raise a
KeyError. It's not clear what use case the current behavior is enabling / preserving. The behavior ofgetRecordin particular is non-obvious, and caused JSON decoding errors when trying to decipher an empty string.