Uncaught error "Uncaught (in promise) PythonError: pyodide.ffi.JsException: Error: Unrecognized format character 'O'." #4743
Replies: 1 comment 1 reply
-
This is related to a rather annoying issue with buffer format strings. Pep 3118 (accepted 28-Aug-2006) added a bunch of features to the buffer format protocol and said Python builtin modules array and ctypes would be updated to handle them. They did not. Numpy started using some of these features, but others have never been implemented anywhere and there is no formal grammar. Anyways O is one feature that numpy supports but ctypes and array do not. Pyodide's implementation of buffer logic follows the simpler logic in ctypes/array since numpy is super complicated and I couldn't follow it. The last time someone reported this bug I tried to implement support for Pep 3118 format strings, got confused and bogged down, and never added support. I think adding support for O specifically would not be that hard. The main question is how to handle reference counts. I am not sure of a way to implement this that doesn't leak Python objects. |
Beta Was this translation helpful? Give feedback.
-
First time it works perfectly fine second time if we try to upload CSV it gives error.
Beta Was this translation helpful? Give feedback.
All reactions