Re: [Django] #26210: When emailing the admins about exceptions and an error occurs, it continues as if there had been no error

2016-02-12 Thread Django
#26210: When emailing the admins about exceptions and an error occurs, it 
continues
as if there had been no error
-+--
 Reporter:  aptiko   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by aptiko):

 It is intentional that the failure of the emailing be silent. However, the
 proper way of achieving this is the following pseudocode:

 {{{
 try:
 connect_to_the_mail_server();
 say_ehlo();
 start_tls();
 say_ehlo();
 login();
 specify_mailfrom_rcptto_and_data();
 close_connection_to_the_mail_server();
 except:
 pass;
 }}}

 Instead, what it now does is this:

 {{{
 try:
 connect_to_the_mail_server();
 say_ehlo();
 start_tls();
 say_ehlo();
 login();
 except:
 pass;

 try:
 specify_mailfrom_rcptto_and_data();
 except:
 pass;

 try:
 close_connection_to_the_mail_server();
 except:
 pass;
 }}}

 (The first block is what `open()` does, the second is what
 `send_messages()` does, and the third is what `close()` does; these are
 methods in `django.core.mail.backend.smtp.EmailBackend`.)

 Call me a perfectionist (with deadlines), but it's really ugly to proceed
 with the second block if an error has occurred on the first block. I
 haven't seen any really bad consequences (other than that it made it
 harder for me to debug an unrelated problem I was having), but it's risky.

 It's not hard to fix with a little restructuring of the code (unit testing
 such restructuring is the hardest part), but I'm not volunteering to do
 it, sorry :-)

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.32ca5d4a9182742cba1d72cb6a4c2a85%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26210: When emailing the admins about exceptions and an error occurs, it continues as if there had been no error

2016-02-11 Thread Django
#26210: When emailing the admins about exceptions and an error occurs, it 
continues
as if there had been no error
-+--
 Reporter:  aptiko   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 This looks like intentional behavior as described in #19637. I'm not sure
 what change we could make other than document it. Do you have a proposal?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.6bcfc303e7f7a76606d247514d7531b0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26210: When emailing the admins about exceptions and an error occurs, it continues as if there had been no error

2016-02-11 Thread Django
#26210: When emailing the admins about exceptions and an error occurs, it 
continues
as if there had been no error
-+
 Reporter:  aptiko   |  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Core (Mail)  |Version:  1.9
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+
 My server had a 500 error, and Django was trying to email the error
 information to the ADMINS. Upon reaching
 
https://github.com/django/django/blob/0ed7d15/django/core/mail/backends/smtp.py#L64,
 there was an exception because of a gevent bug.

 In that case, `fail_silently` is True. The result is that the `open()`
 method returns as if everything had gone fine. This means that,
 subsequently, the `send_messages()` method will be called, and so on.

 Impact: Maybe this is just a bit ugly, however if you continue to work as
 if there had been no error when an error has actually occurred, you are
 asking for trouble. http://stackoverflow.com/questions/35315397/ shows why
 this issue made debugging another problem a day or two longer.

 It should also be possible to log the error that occurs during the sending
 of the email, although this is probably a different issue.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.4774b6672c11fdc9ee42bfd7ddd0325f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.