Ticket #42 (closed defect: fixed)
cvs source UnicodeDecodeError
| Reported by: | anonymous | Owned by: | lele |
|---|---|---|---|
| Priority: | minor | Milestone: | VersionOne |
| Component: | cvs | Version: | 0.9 |
| Keywords: | cvs source bootstrapping error UnicodeDecodeError | Cc: |
Description
Problem description
I've been trying to import multiple cvs projects using tailor rev [1075]. Some works, but some fails with the following error while bootstrapping HEAD.
- symptoms
File "/usr/lib/python2.4/codecs.py", line 290, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 28: ordinal not in range(128)
... hum obviously the problem here is the ascii decoding function is too strict with cvs repositories where the rlog contains some invalid chars.
Quick fix
vcpx/repository.py @ lines 100,101
- Original Source
self.encoding_errors_policy = cget(self.name, 'encoding-errors-policy', 'strict') - Modified source
self.encoding_errors_policy = cget(self.name, 'encoding-errors-policy', 'ignore')
solved the problem for me, but i guess this might apply only as a temporary solution... (sorry i'm no python expert).
btw ... thx for this great tool !
Change History
comment:2 Changed 7 years ago by anonymous
Hi lele,
i guess so,
sorry i did not found out earlier, so, for people ending up on this page the following line can be added to your configuration file :
encoding-errors-policy = ignore
Could the code, either point out the error, and/or output the correct configuration sequence, and/or catch it by hitself and adapt seamlessly ?
thx.
comment:3 Changed 7 years ago by Lele Gaifax
- Priority changed from major to minor
Yes, that would be nicer. It should probably be enough to catch also the UnicodeDecodeError exception in vcpx/tailor.py@1065#L145.

Isn't it enough to set the ignore value in the configuration?