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 : AttributeError: 'coroutine' object has no attribute 'src' #1232

Open
git-akispa opened this issue Jan 6, 2025 · 0 comments
Open

Bug : AttributeError: 'coroutine' object has no attribute 'src' #1232

git-akispa opened this issue Jan 6, 2025 · 0 comments

Comments

@git-akispa
Copy link

Error message:

AttributeError: 'coroutine' object has no attribute 'src' C:\Users\MyUser\Desktop\Jarvis\jarviscli\CmdInterpreter.py:297: RuntimeWarning: coroutine 'Translator.translate' was never awaited print(Fore.RESET) RuntimeWarning: Enable tracemalloc to get the object allocation traceback

How to reproduce:

1. Clone from the main branch.
2. Run the command python installer
3. Run the command ./jarvis
4. Run any translate request

Expected behaviour:

No Error

Machine details:

Windows 11 Pro, Running commands from CMD within the Jarvis installation directory.

Additional details:

Googletrans was recently updated to version 4.0.2, and as the link below shows, the way you use the module has changed.
https://pypi.org/project/googletrans/

Proposed fix:

I have made the changes and making a Pull Request changing the code, while also implementing some new features:

1. Adding the word auto as a source language for automatic language detection
2. Adding the ability to add a path as text input for .txt file translation*
3. Adding the ability to save the output to a file**

*The maximum number of characters the API can handle in one request is 15k, so I am implementing the ability to break the text 
into smaller chunks and translate them separately. The separation is done at a new line character for minimum semantic loss.

**The file is at a default path under the Jarvis directory and also for the case where the input is a file with more than 10k characters 
the output is stored in the file instead of being printed in the console as it would clutter it. 
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

1 participant