From a5bd23d792ea962fbf3e7803b76397a23c29938d Mon Sep 17 00:00:00 2001 From: Nikhil Rao Date: Sun, 29 Jan 2023 21:43:26 -0800 Subject: [PATCH] Fix event encoding (#393) --- pynecone/event.py | 2 +- pynecone/var.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pynecone/event.py b/pynecone/event.py index a2f77d901..614c84986 100644 --- a/pynecone/event.py +++ b/pynecone/event.py @@ -64,7 +64,7 @@ class EventHandler(Base): # Otherwise, convert to JSON. try: - values.append(json.dumps(arg)) + values.append(json.dumps(arg, ensure_ascii=False)) except TypeError as e: raise TypeError( f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." diff --git a/pynecone/var.py b/pynecone/var.py index dc1a2ffa2..ce86ceaf3 100644 --- a/pynecone/var.py +++ b/pynecone/var.py @@ -716,14 +716,6 @@ class BaseVar(Var, Base): return setter - def json(self) -> str: - """Convert the object to a json string. - - Returns: - The object as a json string. - """ - return self.__config__.json_dumps(self.dict()) - class ComputedVar(property, Var): """A field with computed getters."""