#31348: Unhandled exception Python 3.8.2 in django tutorial part 2
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  robintyagiandersson                |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  3.0
  Uncategorized                      |       Keywords:  bug python 3.8.2
               Severity:  Normal     |  tutorial
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hi,

 I am using django version 3.0.4, Python 3.8.2 (Python 3.8.2
 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
 on win32).

 I am new to django and doing the tutorial on the django website. In the
 second tutorial where we use the interactive shell, we added choices using
 code:

 {{{
 # Create three choices.
 >>> q.choice_set.create(choice_text='Not much', votes=0)
 <Choice: Not much>
 >>> q.choice_set.create(choice_text='The sky', votes=0)
 <Choice: The sky>
 >>> c = q.choice_set.create(choice_text='Just hacking again', votes=0)
 }}}
 This could executes fine, but for the sake of testing I tried:

 {{{
 >>> c = q.choice_set.create(choice_text='hacking some choices',
 votes=3151)
 }}}
 which results in the following unhandled exception:

 {{{
 Unhandled exception in event loop:
   File "C:\some-path\Python\Python38\lib\asyncio\proactor_events.py", line
 768, in _loop_self_reading
     f.result()  # may raise
   File "C:\some-path\Python38\lib\asyncio\windows_events.py", line 808, in
 _poll
     value = callback(transferred, key, ov)
   File "C:\some-path\Python38\lib\asyncio\windows_events.py", line 457, in
 finish_recv
     raise ConnectionResetError(*exc.args)

 Exception [WinError 995] The I/O operation has been aborted because of
 either a thread exit or an application request
 }}}
 The choice that caused the exception still gets created even though the
 exception occurred. Then proceeding with the tutorial and ignoring the
 Exception, we try to use the method count by:

 {{{
 >>> q.choice_set.count()
 3
 }}}

 When I try to do it on my side, I again get an exception:

 {{{
 n [16]: q.choice_set.count()
 Out[16]: 6


 Unhandled exception in event loop:
   File "C:\some-path\Python\Python38\lib\asyncio\proactor_events.py", line
 768, in _loop_self_reading
     f.result()  # may raise
   File "C:\some-path\Python\Python38\lib\asyncio\windows_events.py", line
 808, in _poll
     value = callback(transferred, key, ov)
   File "C:\some-path\Python\Python38\lib\asyncio\windows_events.py", line
 457, in finish_recv
     raise ConnectionResetError(*exc.args)
 }}}

 Again, I'm new to django but I cant see why the code I executed would
 cause any Unhandled Exceptions like these.
 Please let me know if you need any additional information.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31348>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.5296b20dbe13a6c6531e9cfa7dde878f%40djangoproject.com.

Reply via email to