You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug only occurs in the NPM version. I can't replicate this in a browser.
When using a custom stdin callback, if an empty string is returned, an EOFError is thrown. An empty string seems to be acting the same as null or undefined. I tried changing autoEOF to false but that didn't have an effect.
To Reproduce
Make a new node project and put the following code in the the index.js
const{ loadPyodide }=require("pyodide");consttestStdin=async(arr)=>{constpy=awaitloadPyodide();letidx=0;py.setStdin({stdin: ()=>{returnarr[idx++];}});py.runPython(` a = input() b = input() c = input() print(a) print(b) print(c) `);}testStdin(['asdf','qwer','']).then(console.log).catch(console.error)
An EOFError is thrown
This code works correctly if the last item in the array is not empty
Expected behavior
Expected to see the value of c be assigned ""
Environment
Pyodide Version: 0.24.0
Node version: 20.5.0
Any other relevant information:
Additional context
The text was updated successfully, but these errors were encountered:
The problem seems to be here, where undefined is returned because the empty string is a falsy value. @hoodmane What would be the intended behavior here?
馃悰 Bug
This bug only occurs in the NPM version. I can't replicate this in a browser.
When using a custom stdin callback, if an empty string is returned, an EOFError is thrown. An empty string seems to be acting the same as null or undefined. I tried changing autoEOF to false but that didn't have an effect.
To Reproduce
Make a new node project and put the following code in the the index.js
This code works correctly if the last item in the array is not empty
Expected behavior
Expected to see the value of c be assigned ""
Environment
Additional context
The text was updated successfully, but these errors were encountered: