Closed adthrasher closed 4 years ago
The following line causes an error when running on Python3. Setting the encoding on the 0 byte string seems to fix the problem.
https://github.com/bxlab/bx-python/blob/f0d2c3e762f64961f0cb931b5300d4ea2bcaa03d/lib/bx/bbi/bpt_file.pyx#L74
Suggested change:
- key += ( '\0' * ( self.key_size - len(key) ) ) + key += ( '\0'.encode('utf-8') * ( self.key_size - len(key) ) )
- key += ( '\0' * ( self.key_size - len(key) ) )
+ key += ( '\0'.encode('utf-8') * ( self.key_size - len(key) ) )
Thanks for the quick fix!
The following line causes an error when running on Python3. Setting the encoding on the 0 byte string seems to fix the problem.
https://github.com/bxlab/bx-python/blob/f0d2c3e762f64961f0cb931b5300d4ea2bcaa03d/lib/bx/bbi/bpt_file.pyx#L74
Suggested change:
- key += ( '\0' * ( self.key_size - len(key) ) )
+ key += ( '\0'.encode('utf-8') * ( self.key_size - len(key) ) )