[Django] #28091: Hiding 'cursor does not exist' error doesn't work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
               Reporter:  Claude     |          Owner:  nobody
  Paroz                              |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Release    |       Keywords:
  blocker                            |
           Triage Stage:  Accepted   |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In commit [6b6be692fcd102436c7abef1d7b3fa1d37ad4bdf], Django tries to mask
 the 'cursor does not exist' exception because it masks the real database
 exception. Unfortunately, the commit is not fulfilling its promise, as the
 `raise` command just after the `pass`, will in fact raise the second
 exception (the one we are trying to mask) not the original one.

--
Ticket URL: <https://code.djangoproject.com/ticket/28091>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.82d047cebdc55cea17b2ef02109582ee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

 Unfortunately, until now, I wasn't able to reproduce the error with the
 Django test suite. In my project, I had a new model which was not yet
 migrated, but even with that scenario, I was not able to reproduce on
 Django. Any help welcome, as I think a test would be really  helpful here.

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:1>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.0f1477e830b435c876b9fc5bdb2b2886%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by François Freitag):

 * owner:  nobody => François Freitag
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:2>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.a54dc6cae8c2c8e16329d7c205e8ea4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by François Freitag):

 Hi Claude,

 I have
 [https://github.com/django/django/compare/stable/1.11.x...francoisfreitag:28091/hide_cursor_does_not_exist?expand=1
 a test] that's failing before  [6b6be692fcd102436c7abef1d7b3fa1d37ad4bdf]
 and passes after this commit.
 Were you able to gather more information about your failure?

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:3>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.f198ef08e58471e5e5a3e786c0470d41%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

 I'm getting that:
 {{{
 ======================================================================
 ERROR: test_cursor_close_failure_does_not_mask_original_exception
 (backends.tests.BackendTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/claude/checkouts/django-git/tests/backends/tests.py", line
 695, in test_cursor_close_failure_does_not_mask_original_exception
     mock_cursor.execute =
 mock.MagicMock(side_effect=raise_original_exception)
 AttributeError: 'psycopg2.extensions.cursor' object attribute 'execute' is
 read-only
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:4>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.bbedbd4127e996d73c4571871303fbea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by François Freitag):

 I updated the test because my cursor creating was flawed. I should have
 used directly connection.chunked_cursor() instead of trying to be smart
 and use create_cursor().

 Fixing this error made the test fail with:
 {{{
 FAIL: test_cursor_close_failure_does_not_mask_original_exception
 (backends.tests.BackendTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/usr/lib64/python2.7/unittest/case.py", line 329, in run
     testMethod()
   File "/home/freitafr/dev/django/tests/backends/tests.py", line 700, in
 test_cursor_close_failure_does_not_mask_original_exception
     list(persons)
   File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
     self.gen.throw(type, value, traceback)
   File "/home/freitafr/dev/django/django/test/testcases.py", line 615, in
 _assert_raises_message_cm
     self.assertIn(expected_message, str(cm.exception))
   File "/usr/lib64/python2.7/unittest/case.py", line 803, in assertIn
     self.fail(self._formatMessage(msg, standardMsg))
   File "/usr/lib64/python2.7/unittest/case.py", line 410, in fail
     raise self.failureException(msg)
 AssertionError: u'Real exception raised by the database on cursor.execute'
 not found in 'Error when attempting to close the cursor, would mask the
 actual exception'
 }}}

 I opened [https://github.com/django/django/pull/8371 #8371] with a
 suggested way to fix this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:5>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.fd306888e4f100196136d10d083b0d19%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56746fb21f6bbf93fe96f4e3908040111439c9c3" 56746fb2]:
 {{{
 #!CommitTicketReference repository=""
 revision="56746fb21f6bbf93fe96f4e3908040111439c9c3"
 [1.11.x] Fixed #28091 -- Re-raised original exception when closing cursor
 cleanup fails
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:6>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.a4a104c851641b772bbd973f54396ba0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"c9d933ba999ef0c3b37045335715d93e92ddb279" c9d933ba]:
 {{{
 #!CommitTicketReference repository=""
 revision="c9d933ba999ef0c3b37045335715d93e92ddb279"
 [1.11.x] Refs #28091 -- Fixed typo and rephrased 1.11.1 release note.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:7>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.663c455534738459a76d512ab7a3e305%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28091: Hiding 'cursor does not exist' error doesn't work

Django
In reply to this post by Django
#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"8b767986bacaf55ed8d87ca1228002e8a6c259c6" 8b767986]:
 {{{
 #!CommitTicketReference repository=""
 revision="8b767986bacaf55ed8d87ca1228002e8a6c259c6"
 Refs #28091 -- Forwardported 1.11.1 release note.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:8>
Django <https://code.djangoproject.com/>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.d7a64161430cb6d36537bf44d8c29b99%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Loading...