FDiot / code_tympan2

0 stars 0 forks source link

[Build] Error in branch default (Linux Mint 17, gcc 4.8.4) #50

Closed FDiot closed 4 years ago

FDiot commented 7 years ago

Created by bitbucket user bugno on 2017-01-30 08:43 Last updated on 2017-02-28 13:43

Error compiling Cython file:

... return b2ms

def acoustic_solver_by_name(name, foldername): """Load an acoustic solver from its name.""" load_solvers(foldername.encode('utf-8')) ^

/home/triou/Tympan/dev/python/tympan/_business2solver.pyx:56:34: Obtaining 'char const *' from temporary Python value

Error compiling Cython file:

...

cy.locals(computation=tybusiness.Computation) def acoustic_solver_from_computation(computation, foldername): """Load an acoustic solver from a computation.""" load_solvers(foldername.encode('utf-8')) ^

FDiot commented 7 years ago

Bitbucket user bugno commented on 2017-01-30 08:56

"python3 --version" returns Python 3.4.3

"cython --version" returns "Cython version 0.20.1post0"

FDiot commented 7 years ago

Bitbucket user bugno commented on 2017-02-02 15:01

The explaination is here: http://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#caveats-when-using-a-python-string-in-a-c-context

As it said, the rules to detect such errors are only heuristics, so sometimes Cython will complain or not.

I fixed like this:

#!python

        load_solvers(solverdir.encode('utf-8'))

Becomes:

#!python

        tmp = solverdir.encode('utf-8')
        load_solvers(tmp)
FDiot commented 7 years ago

Bitbucket user BachirH changed state from new to resolved on 2017-02-28 13:43