Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_python breaks python that includes single quotes #2171

Closed
Dartoxian opened this issue Feb 15, 2024 · 0 comments · Fixed by #2172 or #2169
Closed

run_python breaks python that includes single quotes #2171

Dartoxian opened this issue Feb 15, 2024 · 0 comments · Fixed by #2172 or #2169
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug

Comments

@Dartoxian
Copy link
Contributor

What's your CLI version?

0.86.18

Description & steps to reproduce

trying to use a single quote character in a run_python command and it seems like at runtime the single quotes get stripped. For example:

    demo = plan.run_python(
        run = """print('hello world')""",
        packages = [
        ],
        args = [
        ],
        files = {
        },
    )

produces the following error:

An error occurred executing instruction (number 1) at DEFAULT_PACKAGE_ID_FOR_SCRIPT[2:26]:
run_python(run="print('hello world')", args=[], packages=[], files={})
 --- at /home/circleci/project/core/server/api_container/server/startosis_engine/startosis_executor.go:157 (sendErrorAndFail) ---
Caused by: Python command: "python -c 'print('hello world')'" exited with code 1 and output
    File "<string>", line 1
      print(hello
           ^
  SyntaxError: '(' was never closed
  
 --- at /home/circleci/project/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_python.go:296 (RunPythonCapabilities.Execute) ---

Desired behavior

I should be able to use single quotes in python commands. I've not checked, but I also want to use single quotes in run_sh ofc.

What is the severity of this bug?

Painful; this is causing significant friction in my workflow.

What area of the product does this pertain to?

CLI: the Command Line Interface

@Dartoxian Dartoxian added the bug Something isn't working label Feb 15, 2024
@github-actions github-actions bot added cli For bugs relating to the CLI painful Painful bug labels Feb 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.86.25](0.86.24...0.86.25)
(2024-02-16)


### Features

* emui builder python nodes
([#2170](#2170))
([26ad571](26ad571))
* kurtosis run `--non-blocking-tasks`
([#2153](#2153))
([6c70247](6c70247))


### Bug Fixes

* allow for single quotes in run_python
([#2172](#2172))
([4048368](4048368)),
closes [#2171](#2171)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug
Projects
None yet
1 participant