UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 (invalid continuation byte)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rubber |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I recently ran into an encoding bug in the Python code. Basically, rubber stop the build of the LaTeX file into PDF, and displays:
Traceback (most recent call last):
File "/usr/bin/rubber", line 17, in <module>
sys.exit (cmdline (args))
File "/usr/lib/
self.main (cmdline)
File "/usr/lib/
self.
File "/usr/lib/
self.build (env)
File "/usr/lib/
ret = env.final.
File "/usr/lib/
rv = self.real_make (force)
File "/usr/lib/
if not self.run ():
File "/usr/lib/
if not self.compile():
File "/usr/lib/
if not self.parse_log ():
File "/usr/lib/
return self.log.readlog (logfile_name, logfile_limit)
File "/usr/lib/
whole_file = fp.read (limit)
File "/usr/lib/
(result, consumed) = self._buffer_
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 34129: invalid continuation byte
I looked a bit to search the origin of the problem (thanks to the stack trace), and I suggest to change the line 183 of /usr/lib/
self.lines = None
try:
- with open (name, encoding='utf-8') as fp:
+ with open (name, encoding='utf-8', errors='replace') as fp:
line = fp.readline ()
After changing this line, it worked like a charm with my files.
Changed in rubber: | |
status: | New → Fix Released |
milestone: | none → 2.0 |
milestone: | 2.0 → none |
Thanks for reporting.
Release 1.5.1 hopefully fixes this issue.