﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31348	Unhandled exception Python 3.8.2 in Django.	Robin	nobody	"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."	Bug	closed	Core (Other)	3.0	Normal	invalid	bug python 3.8.2 tutorial		Unreviewed	0	0	0	0	0	0
