UnicodeDecodeError when find encounters a non-ascii file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gedit Developer Plugins |
Fix Released
|
High
|
Curtis Hovey |
Bug Description
Wile search for text in a firectory with utf-8 files, this error was seen.
Traceback (most recent call last):
File "/usr/lib/
self.run()
File "/home/
self.pattern, substitution=
File "/home/
file_path, match_re, substitution=
File "/home/
for lineno, line in enumerate(file_):
File "/usr/lib/
(result, consumed) = self._buffer_
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 83: invalid continuation byte
Each file is opened as text, but the encoding is not specified. This looks like the utf-8 file is being decoded as ascii. the simple fix is to open the file as utf-8. There is an important nuance with unsupported characters though.
Changed in gdp: | |
milestone: | none → 1.0.0 |
Changed in gdp: | |
status: | In Progress → Fix Committed |
Changed in gdp: | |
status: | Fix Committed → Fix Released |