Tom Wenzheng Tang
Tom Wenzheng Tang
@philippedistributive https://github.com/Distributive-Network/PythonMonkey/pull/156#issuecomment-2112867758 done
@philippedistributive https://github.com/Distributive-Network/PythonMonkey/pull/156#issuecomment-2112867758 done
> @Xmader what do you make of the failed test? The failed tests may be related to https://github.com/Distributive-Network/PythonMonkey/pull/353. It segfaults on `test_strings.py`. https://github.com/Distributive-Network/PythonMonkey/actions/runs/9353575587/job/25744630014?pr=156#step:13:162
> @Xmader what do you make of the failed test? The failed tests may be related to https://github.com/Distributive-Network/PythonMonkey/pull/353. It segfaults on `test_strings.py`. https://github.com/Distributive-Network/PythonMonkey/actions/runs/9353575587/job/25744630014?pr=156#step:13:162
This may actually due to a bug in our implementation for `XMLHTTPRequest` and/or the event-loop. The problem hasn't been seen for a while, especially since https://github.com/Distributive-Network/PythonMonkey/pull/354 and https://github.com/Distributive-Network/PythonMonkey/pull/156 are merged.
PythonMonkey team here. It's recommended to write a py file in `python/pythonmonkey/builtin_modules/fetch.py` if most of your code is implemented in Python. ```py def fetch(): ... from pythonmonkey import globalThis if...
Hi @joshmossas, The [`Response.body`](https://developer.mozilla.org/en-US/docs/Web/API/Response/body) should be a getter returning a `ReadableStream` by [the spec](https://fetch.spec.whatwg.org/#dom-body-body). But in the polyfill's [`Response._initBody` constructor method](https://github.com/JakeChampion/fetch/blob/ba5cf1ed2e02ebb96fa1e60b4fd2eb04071b60e4/fetch.js#L225), [`body`](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#body) can be any of the types in [`BodyInit`...
See also: https://github.com/JakeChampion/fetch/issues/746 and https://github.com/JakeChampion/fetch/issues/198#issuecomment-494361060
It's because of what the polyfill [does around XMLHttpRequest](https://github.com/JakeChampion/fetch/blob/27e1c75/fetch.js#L540-L557): Response object resolves on the [XMLHttpRequest load event](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/load_event), i.e. the XMLHttpRequest must already complete successfully. @JakeChampion Maybe changing it to first...
Also https://github.com/Distributive-Network/PythonMonkey/actions/runs/9511340067/job/26217301445#step:13:151 It seems that the CI fails on `tests\python\test_strings.py` randomly.