Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: 6.20/02, 6.20/04
-
Component/s: PyROOT
-
Labels:None
-
Environment:
x86_64-centos7-gcc48-opt
Description
ROOT.py set_size() calls buf.SetSize(), which is deprecated in TPyBufferFactory.cxx.
I encountered this with TGraph::GetX(), eg.
>>> import ROOT
|
>>> g=ROOT.TGraph(5)
|
>>> x=g.GetX()
|
/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.20.04/x86_64-centos7-gcc48-opt/lib/ROOT.py:723: FutureWarning: buffer.SetSize(N) is deprecated and will disappear in a future version of ROOT. Instead, use buffer.reshape((N,))
|
buf.SetSize(self.GetN())
|
>>> list(x)
|
[0.0, 0.0, 0.0, 0.0, 0.0]
|
I can't see a way to fix this in user code, except by filtering the warning:
warnings.filterwarnings("ignore", category=FutureWarning)
|
but obviously that's not ideal.
This seems to have appeared with ROOT 6.20. It was not there in 6.18.