#22111: Signal can throw ValueError in debug mode
------------------------------+------------------------------------
     Reporter:  ilya_pirogov  |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  Python 3      |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  1             |      Needs documentation:  0
  Needs tests:  1             |  Patch needs improvement:  1
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by ilya_pirogov):

 Hello.

 With tests there was a problem that syntax of annotations and keywords-
 only arguments is incorrect for Python 2.
 I created tests where handlers for both Pythons are imported from
 different modules:

 {{{
 @skipIf(six.PY2, 'for Python 3 only')
 class GetargspecPy3TestCase(SimpleTestCase):
     def test_getargspec(self):
         from .py3_handlers import (handler_with_kwargs_only,
                                    handler_with_annotations)
         # ...

 @skipIf(six.PY3, 'for Python 2 only')
 class GetargspecPy2TestCase(SimpleTestCase):
     def test_getargspec(self):
         from .py2_handlers import handler_simple

         # ...
 }}}


 As far as this decision is correct in Django?


 Yes, I think other cases are also affect this problem.
 I wrote compatible implementation of `getargspec` and placed it in
 `django.utils.inspect` module. Then I replaced `import inspect` with this
 module.
 This is an acceptable solution?

 I committed all this on github.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22111#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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.ccf661f091dcd90afd6636f8fb56a459%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to