Modify

Opened 5 years ago

Closed 5 years ago

#6173 closed defect (fixed)

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

Reported by: anonymous Owned by: doki_pen
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 5 years ago by doki_pen

  • Owner changed from doki_pen to anonymous
  • Status changed from new to assigned

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 5 years ago by anonymous

  • Owner changed from anonymous to doki_pen
  • Status changed from assigned to new

comment:3 Changed 5 years ago by doki_pen

  • Status changed from new to assigned

comment:4 Changed 5 years ago by gingerbbm

  • Cc anonymous added; stuart.jones@… 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 5 years ago by doki_pen

  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 5 years ago by doki_pen

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 5 years ago by gingerbbm

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 5 years ago by doki_pen

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

comment:9 Changed 5 years ago by anonymous

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

comment:10 Changed 5 years ago by gingerbbm

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 5 years ago by doki_pen

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

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

Add Comment

Modify Ticket

Action
as closed The owner will remain doki_pen.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.