Opened 3 months ago

Closed 2 months ago

#28034 closed defect (invalid)

py3 failure in repl/ipython_extension.py

Reported by: jhpalmieri Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage -t --long src/sage/repl/ipython_extension.py
**********************************************************************
File "src/sage/repl/ipython_extension.py", line 350, in sage.repl.ipython_extension.SageMagics.cython
Failed example:
    shell.run_cell('''
    %%cython
    def f():
        print('test')
    ''')
Expected nothing
Got:
    ---------------------------------------------------------------------------
    ModuleNotFoundError                       Traceback (most recent call last)
    <ipython-input-1-22d07b1a6610> in <module>()
          1 
    ----> 2 get_ipython().run_cell_magic('cython', '', "def f():\n    print('test')")
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
       2115             magic_arg_s = self.var_expand(line, stack_depth)
       2116             with self.builtin_trap:
    -> 2117                 result = fn(magic_arg_s, cell)
       2118             return result
       2119 
    <BLANKLINE>
    <decorator-gen-118> in cython(self, line, cell)
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
        186     # but it's overkill for just that one bit of state.
        187     def magic_deco(arg):
    --> 188         call = lambda f, *a, **k: f(*a, **k)
        189 
        190         if callable(arg):
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/repl/ipython_extension.py in cython(self, line, cell)
        357         """
        358         from sage.misc.cython import cython_compile
    --> 359         return cython_compile(cell)
        360 
        361     @cell_magic
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/misc/cython.py in cython_compile(code, **kwds)
        649     with open(tmpfile,'w') as f:
        650         f.write(code)
    --> 651     return cython_import_all(tmpfile, get_globals(), **kwds)
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/misc/cython.py in cython_import_all(filename, globals, **kwds)
        539       code
        540     """
    --> 541     m = cython_import(filename, **kwds)
        542     for k, x in iteritems(m.__dict__):
        543         if k[0] != '_':
    <BLANKLINE>
    /Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/misc/cython.py in cython_import(filename, **kwds)
        519     try:
        520         sys.path.append(build_dir)
    --> 521         return builtins.__import__(name)
        522     finally:
        523         sys.path = oldpath
    <BLANKLINE>
    ModuleNotFoundError: No module named '_Users_palmieri__sage_temp_John_iMac_2017_63635_tmp_eevd___2_pyx_0'
**********************************************************************
File "src/sage/repl/ipython_extension.py", line 355, in sage.repl.ipython_extension.SageMagics.cython
Failed example:
    f()
Exception raised:
    Traceback (most recent call last):
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/PYTHON3/sage-8.8.rc2/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1105, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.repl.ipython_extension.SageMagics.cython[3]>", line 1, in <module>
        f()
    NameError: name 'f' is not defined
**********************************************************************
1 item had failures:
   2 of   5 in sage.repl.ipython_extension.SageMagics.cython
    [80 tests, 2 failures, 5.91 s]
----------------------------------------------------------------------
sage -t --long src/sage/repl/ipython_extension.py  # 2 doctests failed
----------------------------------------------------------------------

Change History (4)

comment:1 Changed 3 months ago by jhpalmieri

Is this a real problem? Does anyone else see it? I see it on one OS X machine but not another one.

comment:2 Changed 2 months ago by jhpalmieri

  • Milestone changed from sage-8.9 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

I upgraded the computer and I no longer see this problem. Let's close this.

comment:3 Changed 2 months ago by klee

  • Status changed from needs_review to positive_review

I don't see the problem both on my mac and ubuntu.

comment:4 Changed 2 months ago by chapoton

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