Skip to content

[rejected AI] Fix copying Template objects - #2271

Closed
LouisDeconinck wants to merge 1 commit into
pallets:mainfrom
LouisDeconinck:fix/template-copy-protocol-758
Closed

LouisDeconinck wants to merge 1 commit into
pallets:mainfrom
LouisDeconinck:fix/template-copy-protocol-758

Conversation

@LouisDeconinck

Copy link
Copy Markdown

Fixes #758

Template objects are immutable, so implement the standard copy protocols by returning the existing instance. This avoids invoking Template.new without its required source argument and keeps compiled templates and their environment intact.

Added regression coverage for both shallow and deep copy.

This change was developed with assistance from OpenAI Codex; the final diff and checks were reviewed before submission.

@ThiefMaster

Copy link
Copy Markdown
Member

@davidism davidism changed the title Fix copying Template objects [rejected AI] Fix copying Template objects Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deepcopy(jinja2.Template(...)) raises an exception

3 participants