Skip to content

fix: remove personal name from default template core properties - #1150

Open
RyoKakomi wants to merge 1 commit into
scanny:masterfrom
RyoKakomi:fix/default-template-core-props
Open

RyoKakomi wants to merge 1 commit into
scanny:masterfrom
RyoKakomi:fix/default-template-core-props

Conversation

@RyoKakomi

Copy link
Copy Markdown

Fixes #1149

Problem

The bundled default.pptx ships a docProps/core.xml whose
cp:lastModifiedBy is hard-coded to Steve Canny, with timestamps from
2013. Since Package.core_properties returns the existing part as-is and
CorePropertiesPart.default() only runs when the part is missing, every
presentation created with Presentation() and saved carries that name as
"Last Modified By".

Changes

  • Rewrite docProps/core.xml inside src/pptx/templates/default.pptx:
    cp:lastModifiedBy is now python-pptx (matching
    CorePropertiesPart.default()), and dcterms:created /
    dcterms:modified are refreshed. dc:creator stays empty. All other
    zip entries are copied unchanged, preserving order and compression.
  • Add a test in tests/test_api.py that loads the default template and
    asserts no personal name appears in its core properties.
  • Add an Unreleased entry to HISTORY.rst.

Verification

  • pytest: 2701 passed
  • behave --tags=-wip: 973 scenarios passed
  • Saved a presentation from Presentation() and confirmed
    <cp:lastModifiedBy>python-pptx</cp:lastModifiedBy> and an empty
    <dc:creator/> in the output.

Note: the test suite currently fails collection on pytest 9 because of
PytestRemovedIn10Warning (class-scoped fixtures as instance methods),
which is unrelated to this change. I ran with that warning ignored.

The bundled default.pptx carried a hard-coded personal name in
cp:lastModifiedBy of docProps/core.xml, so every presentation created
with Presentation() and saved kept that name as "last modified by".

- set cp:lastModifiedBy to "python-pptx"
- refresh dcterms:created / dcterms:modified from their 2013 values
- add a test asserting no personal name appears in the default core.xml
- add an Unreleased entry to HISTORY.rst
@RyoKakomi
RyoKakomi marked this pull request as ready for review September 30, 2026 04:36
@RyoKakomi
RyoKakomi marked this pull request as draft September 30, 2026 04:36
@RyoKakomi
RyoKakomi marked this pull request as ready for review September 30, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant