mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
use io.read_text to avoid unicode errors in repomap #305
This commit is contained in:
parent
5df4f2f1a4
commit
f0c575e413
1 changed files with 6 additions and 2 deletions
|
@ -143,7 +143,9 @@ class RepoMap:
|
||||||
return
|
return
|
||||||
query_scm = query_scm.read_text()
|
query_scm = query_scm.read_text()
|
||||||
|
|
||||||
code = Path(fname).read_text(encoding=self.io.encoding)
|
code = self.io.read_text(fname)
|
||||||
|
if not code:
|
||||||
|
return
|
||||||
tree = parser.parse(bytes(code, "utf-8"))
|
tree = parser.parse(bytes(code, "utf-8"))
|
||||||
|
|
||||||
# Run the tags queries
|
# Run the tags queries
|
||||||
|
@ -371,9 +373,11 @@ class RepoMap:
|
||||||
output += "\n" + cur_fname + "\n"
|
output += "\n" + cur_fname + "\n"
|
||||||
|
|
||||||
if type(tag) is Tag:
|
if type(tag) is Tag:
|
||||||
|
code = self.io.read_text(tag.fname) or ""
|
||||||
|
|
||||||
context = TreeContext(
|
context = TreeContext(
|
||||||
tag.rel_fname,
|
tag.rel_fname,
|
||||||
Path(tag.fname).read_text(self.io.encoding),
|
code,
|
||||||
color=False,
|
color=False,
|
||||||
line_number=False,
|
line_number=False,
|
||||||
child_context=False,
|
child_context=False,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue