Opened 3 years ago

Closed 3 years ago

#19827 closed Bug (fixed)

Exception reraise in defaulttags shoud keep stacktrace

Reported by: Kronuz Owned by: regebro
Component: Template system Version: 1.4
Severity: Normal Keywords: sprint2013
Cc: Kronuz Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

I've stumbled upon a problem where a reraised exception doesn't keep the original stacktrace. I'm attaching a patch to fix this

Attachments (3)

#19827-stacktrace_on_reraise.diff (1.1 KB) - added by Kronuz 3 years ago.
19827-stacktrace_on_reraise.diff (2.3 KB) - added by regebro 3 years ago.
Patch using six.
19827-stacktrace_on_reraise.2.diff (2.3 KB) - added by regebro 3 years ago.
Replacement based on feedback from claudep

Download all attachments as: .zip

Change History (13)

comment:1 Changed 3 years ago by Kronuz

  • Cc Kronuz added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by aaugustin

  • Has patch set
  • Needs tests set
  • Patch needs improvement set

The patch must use six.reraise for Python 3 compatibility.

See. https://docs.djangoproject.com/en/dev/topics/python3/#exceptions

Changed 3 years ago by Kronuz

comment:3 Changed 3 years ago by carljm

  • Component changed from Uncategorized to Template system
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

comment:4 Changed 3 years ago by regebro

  • Owner changed from nobody to regebro
  • Status changed from new to assigned
Last edited 3 years ago by regebro (previous) (diff)

comment:5 Changed 3 years ago by regebro

I've added a patch that uses six to solve this issue.

Changed 3 years ago by regebro

Patch using six.

comment:6 Changed 3 years ago by regebro

  • Needs tests unset

Updated patch with a test.

comment:7 Changed 3 years ago by regebro

  • Easy pickings set

comment:8 Changed 3 years ago by gnosek

  • Triage Stage changed from Accepted to Ready for checkin

Changed 3 years ago by regebro

Replacement based on feedback from claudep

comment:9 Changed 3 years ago by oinopion

  • Keywords sprint2013 added

comment:10 Changed 3 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 687d2e967dbc7c2ba29a90c74becc539d3ac2b9d:

Fixed #19827 -- Kept stacktrace in defaulttags exception reraising

Thanks Kronuz for the report and the initial patch.

Note: See TracTickets for help on using tickets.
Back to Top