prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  unexpected 'str' during Arrow test
  testing on Windows Python 3.4.4/Qt5.5.1/ PyQtgraph github of 20160102, I have thefollowing  error on "Arrow" test:
  
  ```
  Using PyQt5 (default graphics system)
  Using PyQt5 (default graphics system)
  Using PyQt5 (default graphics system)
  Using PyQt5 (default graphics system)
  Traceback (most recent call last):
    File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
  \lib\site-packages\pyqtgraph\examples\Arrow.py", line 50, in <module>
      anim = a.makeAnimation(loop=-1)
    File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
  \lib\site-packages\pyqtgraph\graphicsItems\CurvePoint.py", line 94, in makeAnima
  tion
      anim = QtCore.QPropertyAnimation(self, prop)
  TypeError: arguments did not match any overloaded call:
    QPropertyAnimation(QObject parent=None): too many arguments
    QPropertyAnimation(QObject, QByteArray, QObject parent=None): argument 2 has u
  nexpected type 'str'
  
  ```
  
  
  --- 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/graphicsItems/CurvePoint.py`
  Content:
  ```
  1 from ..Qt import QtGui, QtCore
  2 from . import ArrowItem
  3 import numpy as np
  4 from ..Point import Point
  5 import weakref
  6 from .GraphicsObject import GraphicsObject
  7 
  8 __all__ = ['CurvePoint', 'CurveArrow']
  9 class CurvePoint(GraphicsObject):
  10     """A GraphicsItem that sets its location to a point on a PlotCurveItem.
  11     Also rotates to be tangent to the curve.
  12     The position along the curve is a Qt property, and thus can be easily animated.
  13     
  14     Note: This class does not display anything; see CurveArrow for an applied example
  15     """
  16     
  17     def __init__(self, curve, index=0, pos=None, rotate=True):
  18         """Position can be set either as an index referring to the sample number or
  19         the position 0.0 - 1.0
  20         If *rotate* is True, then the item rotates to match the tangent of the curve.
  21         """
  22         
  23         GraphicsObject.__init__(self)
  24         #QObjectWorkaround.__init__(self)
  25         self._rotate = rotate
  26         self.curve = weakref.ref(curve)
  27         self.setParentItem(curve)
  28         self.setProperty('position', 0.0)
  29         self.setProperty('index', 0)
  30         
  31         if hasattr(self, 'ItemHasNoContents'):
  32             self.setFlags(self.flags() | self.ItemHasNoContents)
  33         
  34         if pos is not None:
  35             self.setPos(pos)
  36         else:
  37             self.setIndex(index)
  38             
  39     def setPos(self, pos):
  40         self.setProperty('position', float(pos))## cannot use numpy types here, MUST be python float.
  41         
  42     def setIndex(self, index):
  43         self.setProperty('index', int(index))  ## cannot use numpy types here, MUST be python int.
  44         
  45     def event(self, ev):
  46         if not isinstance(ev, QtCore.QDynamicPropertyChangeEvent) or self.curve() is None:
  47             return False
  48             
  49         if ev.propertyName() == 'index':
  50             index = self.property('index')
  51             if 'QVariant' in repr(index):
  52                 index = index.toInt()[0]
  53         elif ev.propertyName() == 'position':
  54             index = None
  55         else:
  56             return False
  57             
  58         (x, y) = self.curve().getData()
  59         if index is None:
  60             #print ev.propertyName(), self.property('position').toDouble()[0], self.property('position').typeName()
  61             pos = self.property('position')
  62             if 'QVariant' in repr(pos):   ## need to support 2 APIs  :(
  63                 pos = pos.toDouble()[0]
  64             index = (len(x)-1) * np.clip(pos, 0.0, 1.0)
  65             
  66         if index != int(index):  ## interpolate floating-point values
  67             i1 = int(index)
  68             i2 = np.clip(i1+1, 0, len(x)-1)
  69             s2 = index-i1
  70             s1 = 1.0-s2
  71             newPos = (x[i1]*s1+x[i2]*s2, y[i1]*s1+y[i2]*s2)
  72         else:
  73             index = int(index)
  74             i1 = np.clip(index-1, 0, len(x)-1)
  75             i2 = np.clip(index+1, 0, len(x)-1)
  76             newPos = (x[index], y[index])
  77             
  78         p1 = self.parentItem().mapToScene(QtCore.QPointF(x[i1], y[i1]))
  79         p2 = self.parentItem().mapToScene(QtCore.QPointF(x[i2], y[i2]))
  80         ang = np.arctan2(p2.y()-p1.y(), p2.x()-p1.x()) ## returns radians
  81         self.resetTransform()
  82         if self._rotate:
  83             self.rotate(180+ ang * 180 / np.pi) ## takes degrees
  84         QtGui.QGraphicsItem.setPos(self, *newPos)
  85         return True
  86         
  87     def boundingRect(self):
  88         return QtCore.QRectF()
  89         
  90     def paint(self, *args):
  91         pass
  92     
  93     def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):
  94         anim = QtCore.QPropertyAnimation(self, prop)
  95         anim.setDuration(duration)
  96         anim.setStartValue(start)
  97         anim.setEndValue(end)
  98         anim.setLoopCount(loop)
  99         return anim
  100 
  101 
  102 class CurveArrow(CurvePoint):
  103     """Provides an arrow that points to any specific sample on a PlotCurveItem.
  104     Provides properties that can be animated."""
  105     
  106     def __init__(self, curve, index=0, pos=None, **opts):
  107         CurvePoint.__init__(self, curve, index=index, pos=pos)
  108         if opts.get('pxMode', True):
  109             opts['pxMode'] = False
  110             self.setFlags(self.flags() | self.ItemIgnoresTransformations)
  111         opts['angle'] = 0
  112         self.arrow = ArrowItem.ArrowItem(**opts)
  113         self.arrow.setParentItem(self)
  114         
  115     def setStyle(self, **opts):
  116         return self.arrow.setStyle(**opts)
  117         
  118
  ```
  --- 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/graphicsItems/CurvePoint.py b/pyqtgraph/graphicsItems/CurvePoint.py
  --- a/pyqtgraph/graphicsItems/CurvePoint.py
  +++ b/pyqtgraph/graphicsItems/CurvePoint.py
  @@ -91,6 +91,11 @@
           pass
       
       def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):
  +        # In Python 3, a bytes object needs to be used as a property name in
  +        # QPropertyAnimation. PyQt stopped automatically encoding a str when a
  +        # QByteArray was expected in v5.5 (see qbytearray.sip).
  +        if not isinstance(prop, bytes):
  +            prop = prop.encode('latin-1')
           anim = QtCore.QPropertyAnimation(self, prop)
           anim.setDuration(duration)
           anim.setStartValue(start)
  
verification_info: {"golden_diff": "diff --git a/pyqtgraph/graphicsItems/CurvePoint.py b/pyqtgraph/graphicsItems/CurvePoint.py\n--- a/pyqtgraph/graphicsItems/CurvePoint.py\n+++ b/pyqtgraph/graphicsItems/CurvePoint.py\n@@ -91,6 +91,11 @@\n         pass\n     \n     def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):\n+        # In Python 3, a bytes object needs to be used as a property name in\n+        # QPropertyAnimation. PyQt stopped automatically encoding a str when a\n+        # QByteArray was expected in v5.5 (see qbytearray.sip).\n+        if not isinstance(prop, bytes):\n+            prop = prop.encode('latin-1')\n         anim = QtCore.QPropertyAnimation(self, prop)\n         anim.setDuration(duration)\n         anim.setStartValue(start)\n", "issue": "unexpected 'str' during Arrow test\ntesting on Windows Python 3.4.4/Qt5.5.1/ PyQtgraph github of 20160102, I have thefollowing  error on \"Arrow\" test:\n\n```\nUsing PyQt5 (default graphics system)\nUsing PyQt5 (default graphics system)\nUsing PyQt5 (default graphics system)\nUsing PyQt5 (default graphics system)\nTraceback (most recent call last):\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\examples\\Arrow.py\", line 50, in <module>\n    anim = a.makeAnimation(loop=-1)\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\graphicsItems\\CurvePoint.py\", line 94, in makeAnima\ntion\n    anim = QtCore.QPropertyAnimation(self, prop)\nTypeError: arguments did not match any overloaded call:\n  QPropertyAnimation(QObject parent=None): too many arguments\n  QPropertyAnimation(QObject, QByteArray, QObject parent=None): argument 2 has u\nnexpected type 'str'\n\n```\n\n", "before_files": [{"content": "from ..Qt import QtGui, QtCore\nfrom . import ArrowItem\nimport numpy as np\nfrom ..Point import Point\nimport weakref\nfrom .GraphicsObject import GraphicsObject\n\n__all__ = ['CurvePoint', 'CurveArrow']\nclass CurvePoint(GraphicsObject):\n    \"\"\"A GraphicsItem that sets its location to a point on a PlotCurveItem.\n    Also rotates to be tangent to the curve.\n    The position along the curve is a Qt property, and thus can be easily animated.\n    \n    Note: This class does not display anything; see CurveArrow for an applied example\n    \"\"\"\n    \n    def __init__(self, curve, index=0, pos=None, rotate=True):\n        \"\"\"Position can be set either as an index referring to the sample number or\n        the position 0.0 - 1.0\n        If *rotate* is True, then the item rotates to match the tangent of the curve.\n        \"\"\"\n        \n        GraphicsObject.__init__(self)\n        #QObjectWorkaround.__init__(self)\n        self._rotate = rotate\n        self.curve = weakref.ref(curve)\n        self.setParentItem(curve)\n        self.setProperty('position', 0.0)\n        self.setProperty('index', 0)\n        \n        if hasattr(self, 'ItemHasNoContents'):\n            self.setFlags(self.flags() | self.ItemHasNoContents)\n        \n        if pos is not None:\n            self.setPos(pos)\n        else:\n            self.setIndex(index)\n            \n    def setPos(self, pos):\n        self.setProperty('position', float(pos))## cannot use numpy types here, MUST be python float.\n        \n    def setIndex(self, index):\n        self.setProperty('index', int(index))  ## cannot use numpy types here, MUST be python int.\n        \n    def event(self, ev):\n        if not isinstance(ev, QtCore.QDynamicPropertyChangeEvent) or self.curve() is None:\n            return False\n            \n        if ev.propertyName() == 'index':\n            index = self.property('index')\n            if 'QVariant' in repr(index):\n                index = index.toInt()[0]\n        elif ev.propertyName() == 'position':\n            index = None\n        else:\n            return False\n            \n        (x, y) = self.curve().getData()\n        if index is None:\n            #print ev.propertyName(), self.property('position').toDouble()[0], self.property('position').typeName()\n            pos = self.property('position')\n            if 'QVariant' in repr(pos):   ## need to support 2 APIs  :(\n                pos = pos.toDouble()[0]\n            index = (len(x)-1) * np.clip(pos, 0.0, 1.0)\n            \n        if index != int(index):  ## interpolate floating-point values\n            i1 = int(index)\n            i2 = np.clip(i1+1, 0, len(x)-1)\n            s2 = index-i1\n            s1 = 1.0-s2\n            newPos = (x[i1]*s1+x[i2]*s2, y[i1]*s1+y[i2]*s2)\n        else:\n            index = int(index)\n            i1 = np.clip(index-1, 0, len(x)-1)\n            i2 = np.clip(index+1, 0, len(x)-1)\n            newPos = (x[index], y[index])\n            \n        p1 = self.parentItem().mapToScene(QtCore.QPointF(x[i1], y[i1]))\n        p2 = self.parentItem().mapToScene(QtCore.QPointF(x[i2], y[i2]))\n        ang = np.arctan2(p2.y()-p1.y(), p2.x()-p1.x()) ## returns radians\n        self.resetTransform()\n        if self._rotate:\n            self.rotate(180+ ang * 180 / np.pi) ## takes degrees\n        QtGui.QGraphicsItem.setPos(self, *newPos)\n        return True\n        \n    def boundingRect(self):\n        return QtCore.QRectF()\n        \n    def paint(self, *args):\n        pass\n    \n    def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):\n        anim = QtCore.QPropertyAnimation(self, prop)\n        anim.setDuration(duration)\n        anim.setStartValue(start)\n        anim.setEndValue(end)\n        anim.setLoopCount(loop)\n        return anim\n\n\nclass CurveArrow(CurvePoint):\n    \"\"\"Provides an arrow that points to any specific sample on a PlotCurveItem.\n    Provides properties that can be animated.\"\"\"\n    \n    def __init__(self, curve, index=0, pos=None, **opts):\n        CurvePoint.__init__(self, curve, index=index, pos=pos)\n        if opts.get('pxMode', True):\n            opts['pxMode'] = False\n            self.setFlags(self.flags() | self.ItemIgnoresTransformations)\n        opts['angle'] = 0\n        self.arrow = ArrowItem.ArrowItem(**opts)\n        self.arrow.setParentItem(self)\n        \n    def setStyle(self, **opts):\n        return self.arrow.setStyle(**opts)\n        \n", "path": "pyqtgraph/graphicsItems/CurvePoint.py"}], "after_files": [{"content": "from ..Qt import QtGui, QtCore\nfrom . import ArrowItem\nimport numpy as np\nfrom ..Point import Point\nimport weakref\nfrom .GraphicsObject import GraphicsObject\n\n__all__ = ['CurvePoint', 'CurveArrow']\nclass CurvePoint(GraphicsObject):\n    \"\"\"A GraphicsItem that sets its location to a point on a PlotCurveItem.\n    Also rotates to be tangent to the curve.\n    The position along the curve is a Qt property, and thus can be easily animated.\n    \n    Note: This class does not display anything; see CurveArrow for an applied example\n    \"\"\"\n    \n    def __init__(self, curve, index=0, pos=None, rotate=True):\n        \"\"\"Position can be set either as an index referring to the sample number or\n        the position 0.0 - 1.0\n        If *rotate* is True, then the item rotates to match the tangent of the curve.\n        \"\"\"\n        \n        GraphicsObject.__init__(self)\n        #QObjectWorkaround.__init__(self)\n        self._rotate = rotate\n        self.curve = weakref.ref(curve)\n        self.setParentItem(curve)\n        self.setProperty('position', 0.0)\n        self.setProperty('index', 0)\n        \n        if hasattr(self, 'ItemHasNoContents'):\n            self.setFlags(self.flags() | self.ItemHasNoContents)\n        \n        if pos is not None:\n            self.setPos(pos)\n        else:\n            self.setIndex(index)\n            \n    def setPos(self, pos):\n        self.setProperty('position', float(pos))## cannot use numpy types here, MUST be python float.\n        \n    def setIndex(self, index):\n        self.setProperty('index', int(index))  ## cannot use numpy types here, MUST be python int.\n        \n    def event(self, ev):\n        if not isinstance(ev, QtCore.QDynamicPropertyChangeEvent) or self.curve() is None:\n            return False\n            \n        if ev.propertyName() == 'index':\n            index = self.property('index')\n            if 'QVariant' in repr(index):\n                index = index.toInt()[0]\n        elif ev.propertyName() == 'position':\n            index = None\n        else:\n            return False\n            \n        (x, y) = self.curve().getData()\n        if index is None:\n            #print ev.propertyName(), self.property('position').toDouble()[0], self.property('position').typeName()\n            pos = self.property('position')\n            if 'QVariant' in repr(pos):   ## need to support 2 APIs  :(\n                pos = pos.toDouble()[0]\n            index = (len(x)-1) * np.clip(pos, 0.0, 1.0)\n            \n        if index != int(index):  ## interpolate floating-point values\n            i1 = int(index)\n            i2 = np.clip(i1+1, 0, len(x)-1)\n            s2 = index-i1\n            s1 = 1.0-s2\n            newPos = (x[i1]*s1+x[i2]*s2, y[i1]*s1+y[i2]*s2)\n        else:\n            index = int(index)\n            i1 = np.clip(index-1, 0, len(x)-1)\n            i2 = np.clip(index+1, 0, len(x)-1)\n            newPos = (x[index], y[index])\n            \n        p1 = self.parentItem().mapToScene(QtCore.QPointF(x[i1], y[i1]))\n        p2 = self.parentItem().mapToScene(QtCore.QPointF(x[i2], y[i2]))\n        ang = np.arctan2(p2.y()-p1.y(), p2.x()-p1.x()) ## returns radians\n        self.resetTransform()\n        if self._rotate:\n            self.rotate(180+ ang * 180 / np.pi) ## takes degrees\n        QtGui.QGraphicsItem.setPos(self, *newPos)\n        return True\n        \n    def boundingRect(self):\n        return QtCore.QRectF()\n        \n    def paint(self, *args):\n        pass\n    \n    def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):\n        # In Python 3, a bytes object needs to be used as a property name in\n        # QPropertyAnimation. PyQt stopped automatically encoding a str when a\n        # QByteArray was expected in v5.5 (see qbytearray.sip).\n        if not isinstance(prop, bytes):\n            prop = prop.encode('latin-1')\n        anim = QtCore.QPropertyAnimation(self, prop)\n        anim.setDuration(duration)\n        anim.setStartValue(start)\n        anim.setEndValue(end)\n        anim.setLoopCount(loop)\n        return anim\n\n\nclass CurveArrow(CurvePoint):\n    \"\"\"Provides an arrow that points to any specific sample on a PlotCurveItem.\n    Provides properties that can be animated.\"\"\"\n    \n    def __init__(self, curve, index=0, pos=None, **opts):\n        CurvePoint.__init__(self, curve, index=index, pos=pos)\n        if opts.get('pxMode', True):\n            opts['pxMode'] = False\n            self.setFlags(self.flags() | self.ItemIgnoresTransformations)\n        opts['angle'] = 0\n        self.arrow = ArrowItem.ArrowItem(**opts)\n        self.arrow.setParentItem(self)\n        \n    def setStyle(self, **opts):\n        return self.arrow.setStyle(**opts)\n        \n", "path": "pyqtgraph/graphicsItems/CurvePoint.py"}]}