The default behaviour for division has changed between Python 2 and Python 3. In Python 3, dividing an integer by an integer returns a float. e.g.
In Python 2, the default behaviour is to return an integer (the floor of the division). e.g.
The current code does not account for this difference, so incorrect results are returned in Python 2. For example, https://github.com/MIT-LCP/wfdb-python/blob/master/wfdb/_rdann.py includes the line:
testbytes=filebytes[:(12+math.ceil(auxlen/2)),:].flatten()