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

Unterminated triple-quoted string literal #48

Closed
Deftera186 opened this issue Jun 22, 2023 · 3 comments
Closed

Unterminated triple-quoted string literal #48

Deftera186 opened this issue Jun 22, 2023 · 3 comments

Comments

@Deftera186
Copy link

Steps to reproduce:

  1. Clone the repository using git clone https://github.com/opensouls/terminal-copilot.git
  2. cd terminal-copilot
  3. python3 -m venv .venv is used to create a new environment.
  4. Activate the environment using source .venv/bin/activate.
  5. Install the requirements using pip install -r requirements.txt.
  6. python3 setup.py install
  7. face an error when running copilot:
Traceback (most recent call last):
  File "/home/deftera/terminal-copilot/.venv/bin/copilot", line 33, in <module>
    sys.exit(load_entry_point('terminal-copilot==1.2.2', 'console_scripts', 'copilot')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/deftera/terminal-copilot/.venv/bin/copilot", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1074, in get_code
  File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/deftera/terminal-copilot/.venv/lib/python3.11/site-packages/terminal_copilot-1.2.2-py3.11.egg/copilot/main.py", line 246
    """
    ^
SyntaxError: unterminated triple-quoted string literal (detected at line 252)

Details about my environment:

  • Python 3.11.3
  • Pip 22.3.1
  • OS: Arch Linux x86_64
  • Shell: zsh 5.9

A possible fix for the Issue (which needs discussion):

The problem seems to be when we are adding prompt += """. Which can be proven, by removing the line, and fixing the problem. The thing is, I don't know what was actually intended (it could be adding a quote, which can be solved by escaping it, or surround it using single quotes if what was intended was to add triple quotes).

https://github.com/opensouls/terminal-copilot/blob/2bca75d526a4ed2712a803a479241c77db7e5d9a/copilot/main.py#LL83C1-L89C47

@github-actions
Copy link

Hey! Thanks for sharing feedback with the community!

@benripka
Copy link

Same issue for me...

@JoelKronander
Copy link
Collaborator

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants