List Info

Thread: Silly behaviour of exception output




Silly behaviour of exception output
user name
2006-12-28 11:02:51
Our team has been using Django for about one year. I find it
difficult to debug
with Django despite the attempt at friendly traceback pages.
It seems Django has
failed to take advantage of the tracebacks that are
available.

First off near line 97 of django/views/debug.py

         if pre_context_lineno:

this test fails constantly because DJango seems to have the
wrong path names for
most modules. It seems Django ends up with pathnames like
./core/handlers/base.py rather than
django/core/handlers/base.py


The result of this failure is that the stack traces have
missing frames and
often the actual error frame is missing. A simple patch to
fix this silliness

Index: django/views/debug.py
============================================================
=======
--- django/views/debug.py       (revision 4207)
+++ django/views/debug.py       (working copy)
 -107,6
+107,20 
                  'post_context': post_context,
                  'pre_context_lineno': pre_context_lineno +
1,
              })
+        else:
+            frames.append({
+                'tb': tb,
+                'filename': filename,
+                'function': function,
+                'lineno': lineno + 1,
+                'vars': tb.tb_frame.f_locals.items(),
+                'id': id(tb),
+                'pre_context': '[unknown pre_context]',
+                'context_line': '[unknown context_line]',
+                'post_context': '[unknown post_context]',
+                'pre_context_lineno': '[unknown
pre_context_lineno]',
+            })
+
          tb = tb.tb_next

      if not frames:


Secondly it seems that bugs in middleware are uncaught eg in

core.handlers.base.BaseHandler.get_response
django/core/handlers/base.py line 58

         # Apply request middleware
         for middleware_method in self._request_middleware:
             response = middleware_method(request)
             if response:
                 return response

is not in the main try block so is not handled properly.
Also the post
processing of responses is broken eg in
django/core/handlers/modpython.py near
line 150

            # Apply response middleware
            for middleware_method in
self._response_middleware:
                response = middleware_method(request,
response)

is outside of any try except block so cannot have a nice
traceback.

A colleague is trying to use a middleware for logging
successes and errors.
However, it seems that using process_exception only sees
errors in the main
callback and not any other middleware methods. Again this
seems to be caused by
the code in BaseHandler.get_response. Surely any error in
middleware is as
damaging as an error in the main callback?
-- 
Robin Becker

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 14:02:58
On 12/28/06, Robin Becker <becker.rggmail.com> wrote:
>
> Our team has been using Django for about one year. I
find it difficult to debug
> with Django despite the attempt at friendly traceback
pages. It seems Django has
> failed to take advantage of the tracebacks that are
available.

This sounds like good input, but you'll have better luck if
you 1)
make a ticket and 2) send the message to django-developers.

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 16:37:28
Jeremy Dunck wrote:
> 
> On 12/28/06, Robin Becker <becker.rggmail.com> wrote:
>>
>> Our team has been using Django for about one year.
I find it difficult 
>> to debug
>> with Django despite the attempt at friendly
traceback pages. It seems 
>> Django has
>> failed to take advantage of the tracebacks that are
available.
> 
> This sounds like good input, but you'll have better
luck if you 1)
> make a ticket and 2) send the message to
django-developers.

......

I don't much care for elite groups, but surely the
developers list is for actual 
developers. I'm willing to submit patches, but I really hope
it's not trac which 
I dislike. Where should I submit these tickets etc etc.
-- 
Robin Becker

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 17:14:22
On 12/28/06, Robin Becker <robinreportlab.com> wrote:
>
> Jeremy Dunck wrote:
...
> > This sounds like good input, but you'll have
better luck if you 1)
> > make a ticket and 2) send the message to
django-developers.
>
> ......
>
> I don't much care for elite groups, but surely the
developers list is for actual
> developers.

My suggestion was not able being elitist.  Unfortunately
(for this
purpose), django-users is fairly high traffic, and
committers don't
always see all messages on the list.

The django-developers list exists not just for people that
have
committer access, but for discussion of development -of-
django, as
opposed to django-users, which exists for people developing
-with-
django.

I was making the suggestion because I'd like to see the
improvements
made, but sending a lone message to dju is a great way for
it to be
forgotten.

Ticketing systems exist for a reason, I'm sure you'll agree.

> I'm willing to submit patches, but I really hope it's
not trac which
> I dislike. Where should I submit these tickets etc etc.

I'm sorry you feel that way, but it is indeed Trac.

Contrib info is here:
http://www.djangoproject.com/documentation/contributing/


And new tickets can be created here:
http://code.d
jangoproject.com/newticket

If you can't bring yourself to make the tickets, please just
make
patches, and I'll do the dirty work of the ticket itself.

Cheers,
  Jeremy

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 17:53:07
Jeremy Dunck wrote:
> 
> 
> The django-developers list exists not just for people
that have
> committer access, but for discussion of development
-of- django, as
> opposed to django-users, which exists for people
developing -with-
> django.
> 
> I was making the suggestion because I'd like to see the
improvements
> made, but sending a lone message to dju is a great way
for it to be
> forgotten.
> 
> Ticketing systems exist for a reason, I'm sure you'll
agree.
> 
>> I'm willing to submit patches, but I really hope
it's not trac which
>> I dislike. Where should I submit these tickets etc
etc.
> 

.........

> 
> If you can't bring yourself to make the tickets, please
just make
> patches, and I'll do the dirty work of the ticket
itself.

no worries, in trac mode I added the patch then the patch
and finally changed 
the summary to start with [patch].
-- 
Robin Becker

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 17:55:20
On 12/28/06, Robin Becker <robinreportlab.com> wrote:
...
>
> no worries, in trac mode I added the patch then the
patch and finally changed
> the summary to start with [patch].
> --

And the uncaught exceptions?

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-28 21:49:43
Jeremy Dunck wrote:
> 
> On 12/28/06, Robin Becker <robinreportlab.com> wrote:
> ...
>>
>> no worries, in trac mode I added the patch then the
patch and finally 
>> changed
>> the summary to start with [patch].
>> -- 
> 
> And the uncaught exceptions?

I'll do another one tomorrow.
-- 
Robin Becker

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Silly behaviour of exception output
user name
2006-12-29 01:46:30

On 28-Dec-06, at 10:07 PM, Robin Becker wrote:

> I don't much care for elite groups,

it is not an elite group - just a division of labour -
django  
development is discussed there
> but surely the developers list is for actual
developers.

no - developers, would-be developers and those who would
like to  
suggest lines of possible development

> I'm willing to submit patches, but I really hope it's
not trac  
> which I dislike. Where should I submit these tickets
etc etc.

unfortunately it is trac - code.djangoproject.com

-- 

regards
kg
http://lawgon.livejourn
al.com
http://nrcfosshelpline
.in/web/



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )