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

[Bug]: (KeyError) '' #1

Closed
ghost opened this issue Dec 4, 2022 · 2 comments
Closed

[Bug]: (KeyError) '' #1

ghost opened this issue Dec 4, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 4, 2022

Contact Details

No response

What happened?

A bug happened!

Version

v0.1

What operating system are you using?

Windows

Relevant log output

KeyError: ''

File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\gui\windows\application.py", line 202, in receive_message
    self.append_to_output(tr('gui.output_text.ai_prompt', message))

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\gui\aliases.py", line 30, in tr
    return app().translator(key, *args, **kwargs)

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\lang.py", line 371, in __call__
    return self.get_translation(key, *args, **kwargs)

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\lang.py", line 389, in get_translation
    return self.language.get(key, *args, **kwargs)

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\lang.py", line 327, in get
    return format_value(result, *args, _language=self, _key_eval=key_eval)

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\lang.py", line 97, in format_value
    value = value.replace(rec_match, _language.get_raw(rec_match.strip('{}')))

  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\chatgpt_gui\lang.py", line 340, in get_raw
    return self._data[key]
@ghost ghost added the bug Something isn't working label Dec 4, 2022
@ghost ghost assigned Cubicpath Dec 4, 2022
@Cubicpath
Copy link
Owner

This seems to be due to the translator interpreting curly braces in the output as language keys, I can release quick fix for this.

@Cubicpath
Copy link
Owner

Run pip install chatgpt-gui --upgrade to get the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant