You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by xi...@apache.org on 2023/10/16 21:22:02 UTC

[tinkerpop] branch add-http-gremlin-python updated: update str translation to use repr()

This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch add-http-gremlin-python
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/add-http-gremlin-python by this push:
     new 931bdd6168 update str translation to use repr()
931bdd6168 is described below

commit 931bdd6168d870300ca046dd35d8742983d26be7
Author: Yang Xia <55...@users.noreply.github.com>
AuthorDate: Mon Oct 16 14:21:55 2023 -0700

    update str translation to use repr()
---
 gremlin-python/src/main/python/gremlin_python/process/translator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gremlin-python/src/main/python/gremlin_python/process/translator.py b/gremlin-python/src/main/python/gremlin_python/process/translator.py
index 9f29e44eb3..95a2dc7fe8 100755
--- a/gremlin-python/src/main/python/gremlin_python/process/translator.py
+++ b/gremlin-python/src/main/python/gremlin_python/process/translator.py
@@ -183,7 +183,7 @@ class Translator:
                     script += 'WithOptions.tokens'
                     with_opts = True
                 elif isinstance(p, str):
-                    script += f'\'{p}\''
+                    script += f'{p!r}'  # use repr() format for canonical string rep
                 elif type(p) == bool:
                     script += 'true' if p else 'false'
                 elif isinstance(p, type(lambda: None)) and p.__name__ == (lambda: None).__name__: