TechNickAI / AICodeBot

AI-powered tool for developers, simplifying coding tasks and improving workflow efficiency. 🤖
GNU Affero General Public License v3.0
47 stars 12 forks source link

commit breaks when committing binary files #52

Closed hanselke closed 1 year ago

hanselke commented 1 year ago

aicodebot, version 0.14.1

It should ignore binary files? The following staged files will be committed: services/tts_piper/en-us-libritts-high.onnx Traceback (most recent call last): File "/home/eighty/.local/bin/aicodebot", line 8, in <module> sys.exit(cli()) File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/eighty/.local/lib/python3.10/site-packages/aicodebot/cli.py", line 117, in commit diff_context = Coder.git_diff_context() File "/home/eighty/.local/lib/python3.10/site-packages/aicodebot/coder.py", line 201, in git_diff_context contents = Path(file_name).read_text() File "/usr/lib/python3.10/pathlib.py", line 1135, in read_text return f.read() File "/usr/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf5 in position 20: invalid start byte

TechNickAI commented 1 year ago

Ooo - good one. I hadn't had any binary files yet.

Thanks for being an early adopter, and telling me what's breaking, it's super helpful to have additional use cases.

TechNickAI commented 1 year ago

Fixed with https://github.com/gorillamania/AICodeBot/commit/adb47498a3e2d60cbfd92d2ebc7eea47dd1082a0

Update to aicodebot > 0.15.1