Opened 6 years ago

Closed 6 years ago

#1340 closed defect (fixed)

[with patch, with positive review] %cython broken if directory name contains spaces

Reported by: malb Owned by: robertwb
Priority: major Milestone: sage-2.9
Component: misc Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Try this from the notebook:

%cython

def foo(e,f):
  return e*f

and you'll get:

Traceback (most recent call last):    
  File "/home/malb/SAGE/local/lib/python2.5/site-packages/sage/server/support.py", line 303, in cython_import_all
    create_local_c_file=create_local_c_file)
  File "/home/malb/SAGE/local/lib/python2.5/site-packages/sage/server/support.py", line 284, in cython_import
    create_local_c_file=create_local_c_file)
  File "/home/malb/SAGE/local/lib/python2.5/site-packages/sage/misc/cython.py", line 220, in cython
    raise RuntimeError, "Error converting %s to C:\n%s\n%s"%(filename, log, err)
RuntimeError: Error converting /home/malb/Texte/Talks/20071129 - SAGE - Paris/sage_notebook/worksheets/admin/2/code/sage47.spyx to C:

Cython (http://cython.org) is a compiler for code written in the
Cython language.  Cython is based on Pyrex by Greg Ewing.

Usage: cython [options] sourcefile.pyx ...

Options:
  -v, --version                  Display version number of cython compiler
  -l, --create-listing           Write error messages to a listing file
  -I, --include-dir <directory>  Search for include files in named directory
                                 (multiply include directories are allowed).
  -o, --output-file <filename>   Specify name of generated C file
  -p, --embed-positions          If specified, the positions in Cython files of each
                                 function definition is embedded in its docstring.
  -z, --pre-import <module>      If specified, assume undeclared names in this 
                                 module. Emulates the behavior of putting 
                                 "from <module> import *" at the top of the file. 
  --incref-local-binop           Force local an extra incref on local variables before
                                 performing any binary operations.
  -D, --no-docstrings            Remove docstrings.
  -a, --annotate                 Produce an colorized version of the source.

Attachments (1)

1340-cython-spaces.patch (1.7 KB) - added by robertwb 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: Changed 6 years ago by was

I cannot replicate this at all. %cython works fine for me in sage-2.8.14, at least on osx. and definitely works fine in 2.8.13 in linux. And there has been no change to related code that I can think of.

 raise RuntimeError, "Error converting %s to C:\n%s\n%s"%(filename, log, err)

What's with the C: -- looks suspicious.

comment:2 in reply to: ↑ 1 Changed 6 years ago by malb

  • Resolution set to invalid
  • Status changed from new to closed

What's with the C: -- looks suspicious.

It's not the driver letter C but, "convert to C" ... and then colon to show what when wrong.

Anyway, I'll invalidate it for now.

comment:3 Changed 6 years ago by malb

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from %cython seriously broken to %cython broken if directory name contains spaces

The problem actually is, that %cython doesn't work well with directory names containing spaces.

Changed 6 years ago by robertwb

comment:4 Changed 6 years ago by robertwb

  • Summary changed from %cython broken if directory name contains spaces to [with patch] %cython broken if directory name contains spaces

comment:5 Changed 6 years ago by mabshoff

  • Summary changed from [with patch] %cython broken if directory name contains spaces to [with patch, with positive review] %cython broken if directory name contains spaces

Looks good to me.

Cheers,

Michael

comment:6 Changed 6 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from reopened to closed

Merged in 2.9.alpha7.

Note: See TracTickets for help on using tickets.