prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  OverflowError in Point.py
  It seems like [this old (2013) bug](https://bugs.launchpad.net/pyqtgraph/+bug/1234528) still hasn't been fixed. I've just bumped into the same error.
  
  I will test solution suggested by author.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pyqtgraph/Point.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 Point.py -  Extension of QPointF which adds a few missing methods.
  4 Copyright 2010  Luke Campagnola
  5 Distributed under MIT/X11 license. See license.txt for more infomation.
  6 """
  7 
  8 from .Qt import QtCore
  9 import numpy as np
  10 
  11 def clip(x, mn, mx):
  12     if x > mx:
  13         return mx
  14     if x < mn:
  15         return mn
  16     return x
  17 
  18 class Point(QtCore.QPointF):
  19     """Extension of QPointF which adds a few missing methods."""
  20     
  21     def __init__(self, *args):
  22         if len(args) == 1:
  23             if isinstance(args[0], QtCore.QSizeF):
  24                 QtCore.QPointF.__init__(self, float(args[0].width()), float(args[0].height()))
  25                 return
  26             elif isinstance(args[0], float) or isinstance(args[0], int):
  27                 QtCore.QPointF.__init__(self, float(args[0]), float(args[0]))
  28                 return
  29             elif hasattr(args[0], '__getitem__'):
  30                 QtCore.QPointF.__init__(self, float(args[0][0]), float(args[0][1]))
  31                 return
  32         elif len(args) == 2:
  33             QtCore.QPointF.__init__(self, args[0], args[1])
  34             return
  35         QtCore.QPointF.__init__(self, *args)
  36         
  37     def __len__(self):
  38         return 2
  39         
  40     def __reduce__(self):
  41         return (Point, (self.x(), self.y()))
  42         
  43     def __getitem__(self, i):
  44         if i == 0:
  45             return self.x()
  46         elif i == 1:
  47             return self.y()
  48         else:
  49             raise IndexError("Point has no index %s" % str(i))
  50         
  51     def __setitem__(self, i, x):
  52         if i == 0:
  53             return self.setX(x)
  54         elif i == 1:
  55             return self.setY(x)
  56         else:
  57             raise IndexError("Point has no index %s" % str(i))
  58         
  59     def __radd__(self, a):
  60         return self._math_('__radd__', a)
  61     
  62     def __add__(self, a):
  63         return self._math_('__add__', a)
  64     
  65     def __rsub__(self, a):
  66         return self._math_('__rsub__', a)
  67     
  68     def __sub__(self, a):
  69         return self._math_('__sub__', a)
  70     
  71     def __rmul__(self, a):
  72         return self._math_('__rmul__', a)
  73     
  74     def __mul__(self, a):
  75         return self._math_('__mul__', a)
  76     
  77     def __rdiv__(self, a):
  78         return self._math_('__rdiv__', a)
  79     
  80     def __div__(self, a):
  81         return self._math_('__div__', a)
  82     
  83     def __truediv__(self, a):
  84         return self._math_('__truediv__', a)
  85     
  86     def __rtruediv__(self, a):
  87         return self._math_('__rtruediv__', a)
  88     
  89     def __rpow__(self, a):
  90         return self._math_('__rpow__', a)
  91     
  92     def __pow__(self, a):
  93         return self._math_('__pow__', a)
  94     
  95     def _math_(self, op, x):
  96         #print "point math:", op
  97         #try:
  98             #fn  = getattr(QtCore.QPointF, op)
  99             #pt = fn(self, x)
  100             #print fn, pt, self, x
  101             #return Point(pt)
  102         #except AttributeError:
  103         x = Point(x)
  104         return Point(getattr(self[0], op)(x[0]), getattr(self[1], op)(x[1]))
  105     
  106     def length(self):
  107         """Returns the vector length of this Point."""
  108         return (self[0]**2 + self[1]**2) ** 0.5
  109     
  110     def norm(self):
  111         """Returns a vector in the same direction with unit length."""
  112         return self / self.length()
  113     
  114     def angle(self, a):
  115         """Returns the angle in degrees between this vector and the vector a."""
  116         n1 = self.length()
  117         n2 = a.length()
  118         if n1 == 0. or n2 == 0.:
  119             return None
  120         ## Probably this should be done with arctan2 instead..
  121         ang = np.arccos(clip(self.dot(a) / (n1 * n2), -1.0, 1.0)) ### in radians
  122         c = self.cross(a)
  123         if c > 0:
  124             ang *= -1.
  125         return ang * 180. / np.pi
  126     
  127     def dot(self, a):
  128         """Returns the dot product of a and this Point."""
  129         a = Point(a)
  130         return self[0]*a[0] + self[1]*a[1]
  131     
  132     def cross(self, a):
  133         a = Point(a)
  134         return self[0]*a[1] - self[1]*a[0]
  135         
  136     def proj(self, b):
  137         """Return the projection of this vector onto the vector b"""
  138         b1 = b / b.length()
  139         return self.dot(b1) * b1
  140     
  141     def __repr__(self):
  142         return "Point(%f, %f)" % (self[0], self[1])
  143     
  144     
  145     def min(self):
  146         return min(self[0], self[1])
  147     
  148     def max(self):
  149         return max(self[0], self[1])
  150         
  151     def copy(self):
  152         return Point(self)
  153         
  154     def toQPoint(self):
  155         return QtCore.QPoint(*self)
  156
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pyqtgraph/Point.py b/pyqtgraph/Point.py
  --- a/pyqtgraph/Point.py
  +++ b/pyqtgraph/Point.py
  @@ -105,7 +105,13 @@
       
       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 OverflowError:
  +            try:
  +                return self[1] / np.sin(np.arctan2(self[1], self[0]))
  +            except OverflowError:
  +                return np.inf
       
       def norm(self):
           """Returns a vector in the same direction with unit length."""
  
verification_info: {"golden_diff": "diff --git a/pyqtgraph/Point.py b/pyqtgraph/Point.py\n--- a/pyqtgraph/Point.py\n+++ b/pyqtgraph/Point.py\n@@ -105,7 +105,13 @@\n     \n     def length(self):\n         \"\"\"Returns the vector length of this Point.\"\"\"\n-        return (self[0]**2 + self[1]**2) ** 0.5\n+        try:\n+            return (self[0]**2 + self[1]**2) ** 0.5\n+        except OverflowError:\n+            try:\n+                return self[1] / np.sin(np.arctan2(self[1], self[0]))\n+            except OverflowError:\n+                return np.inf\n     \n     def norm(self):\n         \"\"\"Returns a vector in the same direction with unit length.\"\"\"\n", "issue": "OverflowError in Point.py\nIt seems like [this old (2013) bug](https://bugs.launchpad.net/pyqtgraph/+bug/1234528) still hasn't been fixed. I've just bumped into the same error.\r\n\r\nI will test solution suggested by author.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nPoint.py -  Extension of QPointF which adds a few missing methods.\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more infomation.\n\"\"\"\n\nfrom .Qt import QtCore\nimport numpy as np\n\ndef clip(x, mn, mx):\n    if x > mx:\n        return mx\n    if x < mn:\n        return mn\n    return x\n\nclass Point(QtCore.QPointF):\n    \"\"\"Extension of QPointF which adds a few missing methods.\"\"\"\n    \n    def __init__(self, *args):\n        if len(args) == 1:\n            if isinstance(args[0], QtCore.QSizeF):\n                QtCore.QPointF.__init__(self, float(args[0].width()), float(args[0].height()))\n                return\n            elif isinstance(args[0], float) or isinstance(args[0], int):\n                QtCore.QPointF.__init__(self, float(args[0]), float(args[0]))\n                return\n            elif hasattr(args[0], '__getitem__'):\n                QtCore.QPointF.__init__(self, float(args[0][0]), float(args[0][1]))\n                return\n        elif len(args) == 2:\n            QtCore.QPointF.__init__(self, args[0], args[1])\n            return\n        QtCore.QPointF.__init__(self, *args)\n        \n    def __len__(self):\n        return 2\n        \n    def __reduce__(self):\n        return (Point, (self.x(), self.y()))\n        \n    def __getitem__(self, i):\n        if i == 0:\n            return self.x()\n        elif i == 1:\n            return self.y()\n        else:\n            raise IndexError(\"Point has no index %s\" % str(i))\n        \n    def __setitem__(self, i, x):\n        if i == 0:\n            return self.setX(x)\n        elif i == 1:\n            return self.setY(x)\n        else:\n            raise IndexError(\"Point has no index %s\" % str(i))\n        \n    def __radd__(self, a):\n        return self._math_('__radd__', a)\n    \n    def __add__(self, a):\n        return self._math_('__add__', a)\n    \n    def __rsub__(self, a):\n        return self._math_('__rsub__', a)\n    \n    def __sub__(self, a):\n        return self._math_('__sub__', a)\n    \n    def __rmul__(self, a):\n        return self._math_('__rmul__', a)\n    \n    def __mul__(self, a):\n        return self._math_('__mul__', a)\n    \n    def __rdiv__(self, a):\n        return self._math_('__rdiv__', a)\n    \n    def __div__(self, a):\n        return self._math_('__div__', a)\n    \n    def __truediv__(self, a):\n        return self._math_('__truediv__', a)\n    \n    def __rtruediv__(self, a):\n        return self._math_('__rtruediv__', a)\n    \n    def __rpow__(self, a):\n        return self._math_('__rpow__', a)\n    \n    def __pow__(self, a):\n        return self._math_('__pow__', a)\n    \n    def _math_(self, op, x):\n        #print \"point math:\", op\n        #try:\n            #fn  = getattr(QtCore.QPointF, op)\n            #pt = fn(self, x)\n            #print fn, pt, self, x\n            #return Point(pt)\n        #except AttributeError:\n        x = Point(x)\n        return Point(getattr(self[0], op)(x[0]), getattr(self[1], op)(x[1]))\n    \n    def length(self):\n        \"\"\"Returns the vector length of this Point.\"\"\"\n        return (self[0]**2 + self[1]**2) ** 0.5\n    \n    def norm(self):\n        \"\"\"Returns a vector in the same direction with unit length.\"\"\"\n        return self / self.length()\n    \n    def angle(self, a):\n        \"\"\"Returns the angle in degrees between this vector and the vector a.\"\"\"\n        n1 = self.length()\n        n2 = a.length()\n        if n1 == 0. or n2 == 0.:\n            return None\n        ## Probably this should be done with arctan2 instead..\n        ang = np.arccos(clip(self.dot(a) / (n1 * n2), -1.0, 1.0)) ### in radians\n        c = self.cross(a)\n        if c > 0:\n            ang *= -1.\n        return ang * 180. / np.pi\n    \n    def dot(self, a):\n        \"\"\"Returns the dot product of a and this Point.\"\"\"\n        a = Point(a)\n        return self[0]*a[0] + self[1]*a[1]\n    \n    def cross(self, a):\n        a = Point(a)\n        return self[0]*a[1] - self[1]*a[0]\n        \n    def proj(self, b):\n        \"\"\"Return the projection of this vector onto the vector b\"\"\"\n        b1 = b / b.length()\n        return self.dot(b1) * b1\n    \n    def __repr__(self):\n        return \"Point(%f, %f)\" % (self[0], self[1])\n    \n    \n    def min(self):\n        return min(self[0], self[1])\n    \n    def max(self):\n        return max(self[0], self[1])\n        \n    def copy(self):\n        return Point(self)\n        \n    def toQPoint(self):\n        return QtCore.QPoint(*self)\n", "path": "pyqtgraph/Point.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nPoint.py -  Extension of QPointF which adds a few missing methods.\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more infomation.\n\"\"\"\n\nfrom .Qt import QtCore\nimport numpy as np\n\ndef clip(x, mn, mx):\n    if x > mx:\n        return mx\n    if x < mn:\n        return mn\n    return x\n\nclass Point(QtCore.QPointF):\n    \"\"\"Extension of QPointF which adds a few missing methods.\"\"\"\n    \n    def __init__(self, *args):\n        if len(args) == 1:\n            if isinstance(args[0], QtCore.QSizeF):\n                QtCore.QPointF.__init__(self, float(args[0].width()), float(args[0].height()))\n                return\n            elif isinstance(args[0], float) or isinstance(args[0], int):\n                QtCore.QPointF.__init__(self, float(args[0]), float(args[0]))\n                return\n            elif hasattr(args[0], '__getitem__'):\n                QtCore.QPointF.__init__(self, float(args[0][0]), float(args[0][1]))\n                return\n        elif len(args) == 2:\n            QtCore.QPointF.__init__(self, args[0], args[1])\n            return\n        QtCore.QPointF.__init__(self, *args)\n        \n    def __len__(self):\n        return 2\n        \n    def __reduce__(self):\n        return (Point, (self.x(), self.y()))\n        \n    def __getitem__(self, i):\n        if i == 0:\n            return self.x()\n        elif i == 1:\n            return self.y()\n        else:\n            raise IndexError(\"Point has no index %s\" % str(i))\n        \n    def __setitem__(self, i, x):\n        if i == 0:\n            return self.setX(x)\n        elif i == 1:\n            return self.setY(x)\n        else:\n            raise IndexError(\"Point has no index %s\" % str(i))\n        \n    def __radd__(self, a):\n        return self._math_('__radd__', a)\n    \n    def __add__(self, a):\n        return self._math_('__add__', a)\n    \n    def __rsub__(self, a):\n        return self._math_('__rsub__', a)\n    \n    def __sub__(self, a):\n        return self._math_('__sub__', a)\n    \n    def __rmul__(self, a):\n        return self._math_('__rmul__', a)\n    \n    def __mul__(self, a):\n        return self._math_('__mul__', a)\n    \n    def __rdiv__(self, a):\n        return self._math_('__rdiv__', a)\n    \n    def __div__(self, a):\n        return self._math_('__div__', a)\n    \n    def __truediv__(self, a):\n        return self._math_('__truediv__', a)\n    \n    def __rtruediv__(self, a):\n        return self._math_('__rtruediv__', a)\n    \n    def __rpow__(self, a):\n        return self._math_('__rpow__', a)\n    \n    def __pow__(self, a):\n        return self._math_('__pow__', a)\n    \n    def _math_(self, op, x):\n        #print \"point math:\", op\n        #try:\n            #fn  = getattr(QtCore.QPointF, op)\n            #pt = fn(self, x)\n            #print fn, pt, self, x\n            #return Point(pt)\n        #except AttributeError:\n        x = Point(x)\n        return Point(getattr(self[0], op)(x[0]), getattr(self[1], op)(x[1]))\n    \n    def length(self):\n        \"\"\"Returns the vector length of this Point.\"\"\"\n        try:\n            return (self[0]**2 + self[1]**2) ** 0.5\n        except OverflowError:\n            try:\n                return self[1] / np.sin(np.arctan2(self[1], self[0]))\n            except OverflowError:\n                return np.inf\n    \n    def norm(self):\n        \"\"\"Returns a vector in the same direction with unit length.\"\"\"\n        return self / self.length()\n    \n    def angle(self, a):\n        \"\"\"Returns the angle in degrees between this vector and the vector a.\"\"\"\n        n1 = self.length()\n        n2 = a.length()\n        if n1 == 0. or n2 == 0.:\n            return None\n        ## Probably this should be done with arctan2 instead..\n        ang = np.arccos(clip(self.dot(a) / (n1 * n2), -1.0, 1.0)) ### in radians\n        c = self.cross(a)\n        if c > 0:\n            ang *= -1.\n        return ang * 180. / np.pi\n    \n    def dot(self, a):\n        \"\"\"Returns the dot product of a and this Point.\"\"\"\n        a = Point(a)\n        return self[0]*a[0] + self[1]*a[1]\n    \n    def cross(self, a):\n        a = Point(a)\n        return self[0]*a[1] - self[1]*a[0]\n        \n    def proj(self, b):\n        \"\"\"Return the projection of this vector onto the vector b\"\"\"\n        b1 = b / b.length()\n        return self.dot(b1) * b1\n    \n    def __repr__(self):\n        return \"Point(%f, %f)\" % (self[0], self[1])\n    \n    \n    def min(self):\n        return min(self[0], self[1])\n    \n    def max(self):\n        return max(self[0], self[1])\n        \n    def copy(self):\n        return Point(self)\n        \n    def toQPoint(self):\n        return QtCore.QPoint(*self)\n", "path": "pyqtgraph/Point.py"}]}