A caller checking that no tracked change is left before releasing a file reads Document.revisions or
rdocx revision list. Both list main-story revisions only, as documented (the CLI says "no revisions in
main story"), so this is a request rather than a defect. compare() writes revisions into headers and
footers, and accept_all() / rdocx revision accept accept them there, so the listing says "none" while
the file still carries tracked changes, and the count reported by accept differs from the list.
import os, subprocess, sys, zipfile
import rdocx
from docx import Document
RDOCX = sys.argv[1] if len(sys.argv) > 1 else "rdocx"
d = Document(); d.add_paragraph("Body."); d.sections[0].footer.paragraphs[0].text = "Footer lorem ipsum"; d.save("rs_a.docx")
d = Document("rs_a.docx"); d.sections[0].footer.paragraphs[0].text = "Footer lorem IPSUM"; d.save("rs_b.docx")
for f in ("rs_red.docx", "rs_acc.docx"):
if os.path.exists(f):
os.remove(f)
subprocess.run([RDOCX, "compare", "rs_a.docx", "rs_b.docx", "--author", "R", "--timestamp", "2026-09-27T12:00:00Z", "-o", "rs_red.docx"], check=True, capture_output=True)
x = zipfile.ZipFile("rs_red.docx").read("word/footer1.xml")
print("footer1.xml of the redline: w:ins", x.count(b"<w:ins "), "w:del", x.count(b"<w:del "))
print("Document.revisions:", rdocx.Document.open("rs_red.docx").revisions)
print("rdocx revision list:", subprocess.run([RDOCX, "revision", "list", "rs_red.docx"], capture_output=True, text=True).stdout.strip())
print("rdocx revision accept:", subprocess.run([RDOCX, "revision", "accept", "rs_red.docx", "-o", "rs_acc.docx"], capture_output=True, text=True).stdout.strip().splitlines()[0])
footer1.xml of the redline: w:ins 1 w:del 1
Document.revisions: ()
rdocx revision list: (no revisions in main story)
rdocx revision accept: accept: 2 revision element(s)
rdocx compare --json has the same shape: "main_story_revisions": 0 next to
"scope": "all-supported-stories", and nothing about the footer. What would help: Revision carrying the
story it belongs to (as StoryItem already does), the listing covering every story compare() and accept
can reach, and the compare summary counting per story. The scope was recorded when revisions was bound
for #94 (PR #109: "a resolution count can be larger than the snapshot length"); this asks to widen the
listing to match.
Environment: main at 9a7ed714 (S75), release build, linux x86_64, python-docx 1.2.0 for the fixtures.
A caller checking that no tracked change is left before releasing a file reads
Document.revisionsorrdocx revision list. Both list main-story revisions only, as documented (the CLI says "no revisions inmain story"), so this is a request rather than a defect.
compare()writes revisions into headers andfooters, and
accept_all()/rdocx revision acceptaccept them there, so the listing says "none" whilethe file still carries tracked changes, and the count reported by accept differs from the list.
rdocx compare --jsonhas the same shape:"main_story_revisions": 0next to"scope": "all-supported-stories", and nothing about the footer. What would help:Revisioncarrying thestory it belongs to (as
StoryItemalready does), the listing covering every storycompare()and acceptcan reach, and the compare summary counting per story. The scope was recorded when
revisionswas boundfor #94 (PR #109: "a resolution count can be larger than the snapshot length"); this asks to widen the
listing to match.
Environment:
mainat9a7ed714(S75), release build, linux x86_64, python-docx 1.2.0 for the fixtures.