mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
Armor AutoCompleter against unicode errors #305
This commit is contained in:
parent
efb3f03a62
commit
f3d3815201
3 changed files with 42 additions and 1 deletions
|
@ -468,3 +468,20 @@ class TestCommands(TestCase):
|
|||
del coder
|
||||
del commands
|
||||
del repo
|
||||
|
||||
def test_cmd_add_unicode_error(self):
|
||||
# Initialize the Commands and InputOutput objects
|
||||
io = InputOutput(pretty=False, yes=True)
|
||||
from aider.coders import Coder
|
||||
|
||||
coder = Coder.create(models.GPT35, None, io)
|
||||
commands = Commands(io, coder)
|
||||
|
||||
fname = "file.txt"
|
||||
encoding = "utf-16"
|
||||
some_content_which_will_error_if_read_with_encoding_utf8 = "ÅÍÎÏ".encode(encoding)
|
||||
with open(fname, "wb") as f:
|
||||
f.write(some_content_which_will_error_if_read_with_encoding_utf8)
|
||||
|
||||
commands.cmd_add("file.txt")
|
||||
self.assertEqual(coder.abs_fnames, set())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue