Opened 6 years ago

Closed 6 years ago

#14579 closed defect (worksforme)

notebook / inspection error

Reported by: cnassau Owned by: jason, mpatel, was, kini
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: notebook Keywords: notebook, traceback
Cc: Merged in:
Authors: Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

I got this Traceback with a notebook based on Sage 5.9:

G = matrix([[2 for u in (1,..,21)] for v in (1,..,21)])
print G
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_47.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("RyA9IG1hdHJpeChbWzIgZm9yIHUgaW4gKDEsLi4sMjEpXSBmb3IgdiBpbiAoMSwuLiwyMSldKQpwcmludCBH"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp6hJvFE/___code___.py", line 4, in <module>
    exec compile(u'print G
  File "", line 1, in <module>
    
  File "matrix0.pyx", line 1729, in sage.matrix.matrix0.Matrix.__repr__ (sage/matrix/matrix0.c:9374)
  File "/waste/cn/sage-5.9/local/lib/python2.7/site-packages/sage/misc/sageinspect.py", line 1915, in sage_getvariablename
    for frame in inspect.stack():
  File "/waste/cn/sage-5.9/local/lib/python/inspect.py", line 1054, in stack
    return getouterframes(sys._getframe(1), context)
  File "/waste/cn/sage-5.9/local/lib/python/inspect.py", line 1032, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/waste/cn/sage-5.9/local/lib/python/inspect.py", line 1007, in getframeinfo
    lines, lnum = findsource(frame)
  File "/waste/cn/sage-5.9/local/lib/python/inspect.py", line 528, in findsource
    if not sourcefile and file[0] + file[-1] != '<>':
IndexError: string index out of range

The code works as expected in a Sage shell.

Change History (4)

comment:1 Changed 6 years ago by nbruin

This is Python issue 17526 and has been resolved upstream.

comment:2 Changed 6 years ago by tscrim

  • Milestone changed from sage-5.11 to sage-duplicate/invalid/wontfix
  • Reviewers set to Travis Scrimshaw
  • Status changed from new to needs_review

I confirmed it was fixed in 5.11.beta3.

comment:3 Changed 6 years ago by tscrim

  • Status changed from needs_review to positive_review

comment:4 Changed 6 years ago by jdemeyer

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