Skip to content

Default template hard-codes "Steve Canny" as last-modified-by in docProps/core.xml #1149

Description

@RyoKakomi

Summary

Every presentation created with Presentation() (no template argument) and
saved carries Steve Canny as the "Last Modified By" document property.
The value comes from the bundled default template, not from user code.

Steps to reproduce

from pptx import Presentation

prs = Presentation()
prs.save("out.pptx")

Then inspect docProps/core.xml inside out.pptx:

<dc:creator></dc:creator>
<cp:lastModifiedBy>Steve Canny</cp:lastModifiedBy>
<dcterms:created xsi:type="dcterms:W3CDTF">2013-01-27T09:14:16Z</dcterms:created>
<dcterms:modified xsi:type="dcterms:W3CDTF">2013-01-27T09:15:58Z</dcterms:modified>

PowerPoint shows "Steve Canny" under File > Info > Related People.

Expected behavior

A freshly generated presentation should not name a specific person. The
library already uses python-pptx as the default last_modified_by in
CorePropertiesPart.default(), so the template should match that.

Root cause

src/pptx/templates/default.pptx ships a docProps/core.xml with
cp:lastModifiedBy set to Steve Canny and 2013-era timestamps.
Package.core_properties returns the existing part as-is, and
CorePropertiesPart.default() only runs when the part is missing, so the
template value is what ends up in the saved file. save() does not touch
core properties either.

Workaround

Set the properties before saving:

prs.core_properties.author = "..."
prs.core_properties.last_modified_by = "..."

Proposed fix

Rewrite docProps/core.xml in the default template so that
cp:lastModifiedBy is python-pptx, refresh the timestamps, and add a
test that guards against a personal name reappearing.

I have this ready on a branch (tests and behave suite pass):
https://github.com/RyoKakomi/python-pptx/tree/fix/default-template-core-props

Happy to open a PR if this is welcome.

Environment

  • python-pptx 1.0.2
  • Python 3.13
  • macOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions