Modify

Opened 7 years ago

Closed 7 years ago

#6173 closed defect (fixed)

AttributeError: 'module' object has no attribute 'format_exc'

Reported by: anonymous Owned by: Robert Corsaro
Priority: normal Component: DateFieldPlugin
Severity: normal Keywords: AttributeError
Cc: Trac Release: 0.11

Description

Nice plugin, but as of today some users are reporting an issue when resolving a ticket (Trac 0.11). I found this ticket which is identical...

http://trac.edgewall.org/ticket/8031

...and it says that it's a problem with the plugin, so I'm raising it here.

Attachments (0)

Change History (11)

comment:1 Changed 7 years ago by Robert Corsaro

Owner: changed from Robert Corsaro to anonymous
Status: newassigned

Can anyone test this patch: It seems like to reproduce you need to fail validation on the date.

diff --git a/datefield/filter.py b/datefield/filter.py
index c057f61..4256c21 100644
--- a/datefield/filter.py
+++ b/datefield/filter.py
@@ -8,7 +8,7 @@ from genshi.builder import tag
 from genshi.filters.transform import Transformer

 import time
-import traceback
+from traceback import traceback
 import re

 class DateFieldModule(Component):

comment:2 Changed 7 years ago by anonymous

Owner: changed from anonymous to Robert Corsaro
Status: assignednew

comment:3 Changed 7 years ago by Robert Corsaro

Status: newassigned

comment:4 Changed 7 years ago by Stuart

Cc: anonymous added; Stuart removed

Hi. I raised this issue - and have now registered.

I'm afraid I don't know how to test the patch. If you can provide some more information on how to apply the patch please let me know.

Thanks.

comment:5 Changed 7 years ago by Robert Corsaro

  1. Open datefield/filter.py
  2. go to the line that says import traceback
  3. change it to "from traceback import traceback"
  4. see if it works

comment:6 Changed 7 years ago by Robert Corsaro

Trying again:

  1. Open datefield/filter.py
  2. go to the line that says import traceback
  3. change it to "from traceback import traceback"
  4. see if it works

comment:7 Changed 7 years ago by Stuart

OK, it looks like my issue can be explained without requiring a patch. The dates were simply in the wrong format.

When I first configured my new custom "Due Date" field it was set to dd/mm/yyyy and the team set about updating their tickets accordingly. Then it transpired that we couldn't sort correctly on this field in the reports, so I reconfigured the dates to be in yyyy/mm/dd format. From that point, anyone updating a ticket got this error. Once all existing dates were changed to yyyy/mm/dd we've had no problems.

Seems obvious now; sorry to waste your time and thanks for the responses.

Resolve as "invalid" or "fixed"?

comment:8 Changed 7 years ago by Robert Corsaro

No. It really was a bug. You should have gotten a nicer error message. If you can't test I will.

comment:9 Changed 7 years ago by anonymous

Oh, right, I'll give it a go then. Watch this space.

comment:10 Changed 7 years ago by Stuart

I made the change but it behaves in the same way as before, throwing up this error:

Trac detected an internal error:

AttributeError: 'module' object has no attribute 'format_exc'

comment:11 Changed 7 years ago by Robert Corsaro

Resolution: fixed
Status: assignedclosed

(In [7155]) invalid dates display proper error fixes #6173

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.