[pypy-dev] targetreallynopstandalone.py => TypeError: string vs LocalPath

Peter Cock p.j.a.cock at googlemail.com
Tue Mar 20 12:51:41 CET 2012

Hi all,

After a teething error with PyPy calling GCC with unescaped paths,
which I solved by moving to a directory without spaces in the full
path, I made some progress.

First, get PyPy from hg - perhaps checking out a known good

$ hg clone http://bitbucket.org/pypy/pypy pypy
$ cd pypy
$ hg checkout release-1.8

Next, using the Richards example (short but non-trivial),

$ cd pypy/translator/goal
$ python translate.py --run targetrichards.py
[translation:info] Running compiled c source...
Richards benchmark (Python) starting...
[<pypy.translator.c.genc.Wrapper instance at 0x102df1170>]
Total time for 500 iterations: 0.58 secs
Average time per iteration: 1.16 ms
Richards benchmark (Python) starting... [<function entry_point at 0x1005acf50>]
Total time for 5 iterations: 1.49 secs
Average time per iteration: 298.09 ms
[Timer] Timings:
[Timer] annotate                       ---  2.7 s
[Timer] rtype_lltype                   ---  0.9 s
[Timer] backendopt_lltype              ---  0.4 s
[Timer] stackcheckinsertion_lltype     ---  0.0 s
[Timer] database_c                     --- 13.7 s
[Timer] source_c                       ---  3.0 s
[Timer] compile_c                      ---  4.8 s
[Timer] run_c                          ---  2.1 s
[Timer] =========================================
[Timer] Total:                         --- 27.6 s

And even simpler example, in principle:

$ python translate.py --run targetreallynopstandalone.py
[translation:info] Running compiled c source...
[Timer] Timings:
[Timer] annotate                       ---  1.5 s
[Timer] rtype_lltype                   ---  0.2 s
[Timer] backendopt_lltype              ---  0.1 s
[Timer] stackcheckinsertion_lltype     ---  0.0 s
[Timer] database_c                     --- 13.9 s
[Timer] source_c                       ---  2.3 s
[Timer] compile_c                      ---  1.3 s
[Timer] run_c                          ---  0.0 s
[Timer] =========================================
[Timer] Total:                         --- 19.4 s
[translation:ERROR] Error:
[translation:ERROR]  Traceback (most recent call last):
[translation:ERROR]    File "translate.py", line 309, in main
[translation:ERROR]     drv.proceed(goals)
[translation:ERROR]    File
"/Users/pjcock/pypy-hg/pypy/translator/driver.py", line 810, in
[translation:ERROR]     return self._execute(goals, task_skip =
[translation:ERROR]    File
"/Users/pjcock/pypy-hg/pypy/translator/tool/taskengine.py", line 116,
in _execute
[translation:ERROR]     res = self._do(goal, taskcallable, *args, **kwds)
[translation:ERROR]    File
"/Users/pjcock/pypy-hg/pypy/translator/driver.py", line 287, in _do
[translation:ERROR]     res = func()
[translation:ERROR]    File
"/Users/pjcock/pypy-hg/pypy/translator/driver.py", line 594, in
[translation:ERROR]     self.backend_run('c')
[translation:ERROR]    File
"/Users/pjcock/pypy-hg/pypy/translator/driver.py", line 588, in
[translation:ERROR]     os.system(c_entryp)
[translation:ERROR]  TypeError: system() argument 1 must be string,
not LocalPath
[translation] start debugger...
> /Users/pjcock/pypy-hg/pypy/translator/driver.py(588)backend_run()
-> os.system(c_entryp)

This looks like a string versus path object error. The same happens
with the default branch, 53817:62902925695c

What's going wrong? Am I invoking translate.py incorrectly?



More information about the pypy-dev mailing list