Opened 9 years ago

Closed 3 years ago

#16088 closed enhancement (worksforme)

py3: different exception messages in doctest

Reported by: Wilfried Luebbe Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords: python3
Cc: Erik Bray, John Palmieri, vklein, Jeroen Demeyer Merged in:
Authors: Reviewers: Vincent Klein
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

Exceptions can look different. For example:

Python 2:

>>> sys.version
'2.7.5+ (default, Feb 27 2014, 19:37:08) \n[GCC 4.8.1]'
>>> 1/0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
>>> 

Python 3:

>>> sys.version
'3.3.2+ (default, Feb 28 2014, 00:52:16) \n[GCC 4.8.1]'
>>> 1/0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
>>> 

This ticket is tracked as a dependency of meta-ticket ticket:16052.

Change History (11)

comment:1 Changed 9 years ago by Wilfried Luebbe

Description: modified (diff)
Summary: Python 3 preparation: Py2 vs. Py3 differences in tracebacksPython 3 preparation: Py2 vs. Py3 different tracebacks in doctest

comment:2 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:3 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:4 Changed 7 years ago by Jeroen Demeyer

Component: distributionpython3

comment:5 Changed 6 years ago by Frédéric Chapoton

Milestone: sage-6.4sage-8.0

comment:6 Changed 5 years ago by Frédéric Chapoton

See also that ones:

git grep -c "TypeError.*takes exactly"
src/sage/algebras/commutative_dga.py:1
src/sage/combinat/alternating_sign_matrix.py:1
src/sage/combinat/combinat.py:5
src/sage/functions/orthogonal_polys.py:1
src/sage/functions/other.py:1
src/sage/interfaces/scilab.py:1
src/sage/misc/explain_pickle.py:2
src/sage/modular/cusps_nf.py:1
src/sage/plot/colors.py:2
src/sage/plot/graphics.py:1
src/sage/rings/polynomial/polynomial_zz_pex.pyx:2
src/sage/symbolic/function.pyx:4

comment:7 Changed 5 years ago by Jeroen Demeyer

Description: modified (diff)
Summary: Python 3 preparation: Py2 vs. Py3 different tracebacks in doctestpy: different exception messages in doctest

comment:8 Changed 5 years ago by Frédéric Chapoton

Summary: py: different exception messages in doctestpy3: different exception messages in doctest

comment:9 Changed 3 years ago by Frédéric Chapoton

Cc: Erik Bray John Palmieri vklein Jeroen Demeyer added
Milestone: sage-8.0sage-duplicate/invalid/wontfix
Status: newneeds_review

I think that we can now close this one as invalid.

comment:10 Changed 3 years ago by vklein

Reviewers: Vincent Klein
Status: needs_reviewpositive_review

comment:11 Changed 3 years ago by Frédéric Chapoton

Resolution: worksforme
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.