Skip to content

A partial merge in TFileMerger creates directories that users didn't ask for #19330

Open
@hageboeck

Description

@hageboeck

Check duplicate issues.

  • Checked for duplicates

Description

See details here:
https://root-forum.cern.ch/t/merge-only-selected-subdirectory-of-some-root-files/63867

Basically, this code should not create the directory B:

import ROOT
with ROOT.TFile("test_input.root", "recreate") as outfile:
    outfile.mkdir("A")
    outfile.mkdir("B")

file_merger = ROOT.TFileMerger(False)
file_merger.AddFile("test_input.root")
file_merger.AddObjectNames("A")
file_merger.OutputFile("test_merged.root")
merge_mode = ROOT.TFileMerger.kOnlyListed | ROOT.TFileMerger.kAll | ROOT.TFileMerger.kIncremental
file_merger.PartialMerge(merge_mode)

Reproducer

See above

ROOT version

All < 6.38

Installation method

Not relevant

Operating system

Not relevant

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions