-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't let uproot.update mess up the TFile fVersion (#1212)
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE | ||
|
||
import os | ||
|
||
import uproot | ||
|
||
|
||
def test(tmp_path): | ||
filename = os.path.join(tmp_path, "whatever.root") | ||
|
||
with uproot.recreate(filename) as file: | ||
file["one"] = "one" | ||
|
||
with uproot.update(filename) as file: | ||
file["two"] = "two" | ||
|
||
with uproot.open(filename) as file: | ||
assert file.file.fVersion == uproot.writing._cascade.FileHeader.class_version |