-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 436: character maps to <undefined> #758
Comments
My impression is that this error is related to the specific file that is read. Would you be able to share it somehow, preferably on your github? |
it is working just fine in WSL |
That is great! But, if we are to solve this problem without WSL, it would be great if we can reproduce it. UnicodeDecodeError sounds like it is related to the file. It would be great if you can try it again after the recent refactor and repost the stack trace (the code has changed quite a lot). |
This easily happens if you have a folder that contains non text files in |
We should try to fix the error message! Like "file xyz is not of text format, please make sure gpt-engineer doesn't read it" |
⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.
Actions (click)
Step 1: 🔎 SearchingI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.gpt-engineer/gpt_engineer/core/steps.py Lines 455 to 747 in c58a37c
gpt-engineer/gpt_engineer/cli/main.py Lines 17 to 169 in c58a37c
gpt-engineer/gpt_engineer/core/chat_to_files.py Lines 1 to 187 in c58a37c
gpt-engineer/tests/test_chat_to_files.py Lines 1 to 199 in c58a37c
gpt-engineer/gpt_engineer/core/domain.py Lines 1 to 19 in c58a37c
Step 2: ⌨️ Coding
• Import the `codecs` module at the top of the file. Step 3: 🔁 Code ReviewI have finished coding the issue. I am now reviewing it for completeness. 🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. |
Fix is out here: |
Expected Behavior
gpt-engineer "path" -i command to work properly
Current Behavior
Error after "Press enter to proceed with modifications."
Steps to Reproduce
windows
python 3.9
Failure Logs
Traceback (most recent call last):
File "C:\tools\Anaconda3\envs\gpteng\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\tools\Anaconda3\envs\gpteng\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\tools\Anaconda3\envs\gpteng\Scripts\gpt-engineer.exe_main_.py", line 7, in
sys.exit(app())
File "C:\tools\Anaconda3\envs\gpteng\lib\site-packages\gpt_engineer\main.py", line 96, in main
messages = step(ai, dbs)
File "C:\tools\Anaconda3\envs\gpteng\lib\site-packages\gpt_engineer\steps.py", line 360, in improve_existing_code
files_info = get_code_strings(dbs.input) # this only has file names not paths
File "C:\tools\Anaconda3\envs\gpteng\lib\site-packages\gpt_engineer\chat_to_files.py", line 113, in get_code_strings
file_data = file.read()
File "C:\tools\Anaconda3\envs\gpteng\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 436: character maps to
Checklist
gpt_engineer/core/chat_to_files.py:get_code_strings
✅ Commit83c9784
The text was updated successfully, but these errors were encountered: