OverFlowError in Point.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyqtgraph |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
This error made my plot unuseable:
Traceback (most recent call last):
File "/usr/lib/
py = 0 if py is None else py.length()
File "/usr/lib/
return (self[0]**2 + self[1]**2) ** 0.5
OverflowError: (34, 'Numerical result out of range')
I don't really know what this part of the code is doing, but a simple try, except clause and returning 0 fixed it for me, my patch:
--- Pointold.py 2013-10-03 08:27:43.516809404 +0000
+++ /usr/lib/
@@ -99,7 +99,10 @@
def length(self):
"""Returns the vector length of this Point."""
- return (self[0]**2 + self[1]**2) ** 0.5
+ try:
+ return (self[0]**2 + self[1]**2) ** 0.5
+ except:
+ return 0
def norm(self):
"""Returns a vector in the same direction with unit length."""
Thank you! This will be fixed in the next release.