Line 346 of encoder.py intends to extend the data stream buffer with padding bits if it does not meet a codeword boundary.
However, if length % 8 is 0, meaning that the length does indeed fall on the codeword boundary, then this implementation adds 8 padding bits, and it should not do so.
You can see the difference in final forms of the encoding of the string known via segno: segno.make("known", version=1, error='L', mode='byte', mask=0, boost_error=False) vs. the equivalent results from and . All three of these will be decoded to the same word, though.
Line 346 of encoder.py intends to extend the data stream buffer with padding bits if it does not meet a codeword boundary.
However, if
length % 8is 0, meaning that the length does indeed fall on the codeword boundary, then this implementation adds 8 padding bits, and it should not do so.You can see the difference in final forms of the encoding of the string
knownvia segno:segno.make("known", version=1, error='L', mode='byte', mask=0, boost_error=False)vs. the equivalent results from and . All three of these will be decoded to the same word, though.