This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: incorrect output "int division or modulo by zero" in Handling Exceptions tutorial
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, python-dev, viorel
Priority: normal Keywords:

Created on 2016-09-28 19:33 by viorel, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg277657 - (view) Author: Viorel Tabara (viorel) Date: 2016-09-28 19:33
I'm reading the Python 3.5.2 documentation at:

which shows the following example:

   >>> def this_fails():
   ...     x = 1/0
   >>> try:
   ...     this_fails()
   ... except ZeroDivisionError as err:
   ...     print('Handling run-time error:', err)
   Handling run-time error: int division or modulo by zero 

Running the code as a script produces:

   $ python3 -V
   Python 3.5.2
   $ python3
   Handling run-time error: division by zero

   $ python2 -V
   Python 2.7.12
   $ python2
   ('Handling run-time error:', ZeroDivisionError('integer division or modulo by zero',))
The same output is listed for 3.6 and 3.7 tutorials but I don't have those 
versions installed on my system.
msg277659 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-28 19:47
New changeset f60396d8f95c by Berker Peksag in branch '3.5':
Issue #28306: Update exception message of ZeroDivisionError

New changeset e6dcb14829cf by Berker Peksag in branch '3.6':
Issue #28306: Merge from 3.5

New changeset ddeeb7d666eb by Berker Peksag in branch 'default':
Issue #28306: Merge from 3.6
msg277660 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-28 19:48
Good catch! Thanks for the report.
Date User Action Args
2022-04-11 14:58:37adminsetgithub: 72493
2016-09-28 19:48:38berker.peksagsetstatus: open -> closed

versions: + Python 3.6, Python 3.7
nosy: + berker.peksag

messages: + msg277660
resolution: fixed
stage: resolved
2016-09-28 19:47:51python-devsetnosy: + python-dev
messages: + msg277659
2016-09-28 19:33:50viorelcreate