Opened 3 years ago

Closed 3 years ago

#27586 closed enhancement (worksforme)

Py3: Fix matrix/ doctests errors

Reported by: vklein Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords:
Cc: Merged in:
Authors: Vincent Klein Reviewers:
Report Upstream: N/A Work issues:
Branch: u/vklein/27586 (Commits, GitHub, GitLab) Commit: 4d569a5619aed5195c5a02f2bfdc561cf78ab1c7
Dependencies: Stopgaps:

Status badges


Fix matrix/ doctests errors. Example :

File "src/sage/matrix/", line 115, in
Failed example:
Exception raised:
    Traceback (most recent call last):
      File "/home/u1/chapoton/sage3/local/lib/python3.6/site-packages/sage/doctest/", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/u1/chapoton/sage3/local/lib/python3.6/site-packages/sage/doctest/", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest[14]>", line 1, in <module>
      File "sage/matrix/matrix0.pyx", line 926, in sage.matrix.matrix0.Matrix.__getitem__ (build/cythonized/sage/matrix/matrix0.c:6734)
        raise TypeError("index must be an integer")
    TypeError: index must be an integer

These errors were caused by range calls (range return iterator in py3).

Change History (8)

comment:1 follow-up: Changed 3 years ago by chapoton

possible conflict with #27585 ?

comment:2 Changed 3 years ago by vklein

  • Branch set to u/vklein/27586

comment:3 in reply to: ↑ 1 Changed 3 years ago by vklein

  • Commit set to 4d569a5619aed5195c5a02f2bfdc561cf78ab1c7

Replying to chapoton:

possible conflict with #27585 ?

It's ok #27585 doesn't modifiy matrix/

New commits:

4d569a5Trac 27586: Py3 Fix matrix/ doctests

comment:4 Changed 3 years ago by vklein

  • Status changed from new to needs_review

comment:5 Changed 3 years ago by jhpalmieri

#27585 makes changes to allow M[range(2),:] to work with Python 3. In particular, it should fix the doctests you are changing. I would request that you put this on hold until #27585 is resolved.

comment:6 Changed 3 years ago by vklein

  • Status changed from needs_review to needs_info

My bad i have missed that point.

comment:7 Changed 3 years ago by vklein

  • Milestone changed from sage-8.8 to sage-duplicate/invalid/wontfix
  • Status changed from needs_info to positive_review

comment:8 Changed 3 years ago by chapoton

  • Resolution set to worksforme
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.