Js2Py icon indicating copy to clipboard operation
Js2Py copied to clipboard

FileNotFoundError with js2py.EvalJs.execute_debug

Open whew opened this issue 5 years ago • 0 comments

>>> context = js2py.EvalJs()  
>>> js_code = 'var a = 10;'
>>> context.execute_debug(js_code)
Traceback (most recent call last):
  File "/home/whew/.local/lib/python3.8/site-packages/js2py/evaljs.py", line 224, in execute_debug
    raise err
  File "/home/whew/.local/lib/python3.8/site-packages/js2py/evaljs.py", line 217, in execute_debug
    with open(filename, mode='w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'temp/_8e588b1cfbaff2ba25eee488d71c56eb.py'

In execute_debug there's no check that the temp folder exists: https://github.com/PiotrDabkowski/Js2Py/blob/master/js2py/evaljs.py#L207

whew avatar Nov 12 '20 04:11 whew