Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10693

[PyROOT] Infinite iteration over RVec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.22/00
    • Component/s: PyROOT
    • Labels:
      None
    • Environment:

      master on commit 6287d8bb49eb1ef9a862c47d30706bb7ffc4a4d3

      Description

      We iterate infinitely if we call explicitely the iterator of an RVec, see the reproducer here:

      import ROOT
       
      x = ROOT.RVec('int')((0, 1, 2, 3))
      print(x)
      print(iter(x))
       
      for a in iter(x):
          print(a)
      

      0
      1
      2
      3
      101
      0
      529
      0
      0
      0
      0
      ...
      

      The issue seems to be the injected tp_iter function via the StlSequenceIter pythonization in CPyCppyy/src/Pythonize.cxx.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                etejedor Enric Tejedor Saavedra
                Reporter:
                swunsch Stefan Wunsch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: