Closed covetedfish closed 4 years ago
One day I will finally succeed in replacing all the float
s with decimal.Decimal
s and then I will finally be happy and not have to keep dealing with this bug.
I'm now getting this when I do ctrl+n:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.8/tkinter/__init__.py", line 1883, in __call__
return self.func(*args)
File "/home/jwashin1/Documents/UltraTrace/ultratrace/modules/textgrid.py", line 542, in getBounds
self.fillCanvases()
File "/home/jwashin1/Documents/UltraTrace/ultratrace/modules/textgrid.py", line 591, in fillCanvases
length = time - strtime
TypeError: unsupported operand type(s) for -: 'float' and 'decimal.Decimal'
d414e6f should fix the issue on that particular line.
I also added a __setattr__
method that will hopefully catch some portion of future type errors of this sort.
More today:
ERROR: unsupported operand type(s) for -: 'decimal.Decimal' and 'float'
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/jwashin1/Documents/UltraTrace/ultratrace/__main__.py", line 615, in <module>
app = App()
File "/home/jwashin1/Documents/UltraTrace/ultratrace/__main__.py", line 93, in __init__
self.filesUpdate()
File "/home/jwashin1/Documents/UltraTrace/ultratrace/__main__.py", line 512, in filesUpdate
self.framesUpdate()
File "/home/jwashin1/Documents/UltraTrace/ultratrace/__main__.py", line 554, in framesUpdate
self.TextGrid.update()
File "/home/jwashin1/Documents/UltraTrace/ultratrace/modules/textgrid.py", line 885, in update
self.start = new_time - (duration/2)
TypeError: unsupported operand type(s) for -: 'float' and 'decimal.Decimal'
A few options for dealing with this:
decimal.Decimal
decimal.Decimal
and use float
everywhere__setattr__
trick to ensure type consistencyIsn't there a reason we're using decimal.Decimal
?
I don't understand what the __setattr__
trick is.
(18:24:29) popcorndude: so between TextGrid 1.4 and 1.5 they completely removed decimal.Decimal
(18:24:46) popcorndude: which explains why we've been getting different errors
Fixed.