Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#31348 closed Bug (invalid)

Unhandled exception Python 3.8.2 in Django.

Reported by: Robin Owned by: nobody
Component: Core (Other) Version: 3.0
Severity: Normal Keywords: bug python 3.8.2 tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (2)

comment:1 by Mariusz Felisiak, 5 years ago

Component: UncategorizedCore (Other)
Resolution: invalid
Status: newclosed
Summary: Unhandled exception Python 3.8.2 in django tutorial part 2Unhandled exception Python 3.8.2 in Django.

Thanks for this ticket, however this is not related with tutorials or even with Django. IMO this is an issue in Python 3.8, see https://bugs.python.org/issue39010.

Closing per TicketClosingReasons/UseSupportChannels.

comment:2 by Robin, 5 years ago

I see, thanks for the quick response. I switched to Python 3.7.4 for now.

Note: See TracTickets for help on using tickets.
Back to Top