UnicodeDecodeError when accented chars are present in test result tables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zelenium |
Fix Released
|
Undecided
|
Tres Seaver |
Bug Description
If a zuite contains accented chars, and those get transplanted into test results, the ZuiteResults object cannot render to html properly resulting in an UnicodeDecodeError:
Traceback (most recent call last):
[...]
File "/home/
return self._bindAndEx
File "/home/
return self._exec(
File "/home/
return self.pt_
File "/home/
showtal=
File "/home/
strictinsert=0, sourceAnnotatio
File "/home/
self.
[...]
File "/home/
structure = self.engine.
File "/home/
return self._handleTex
File "/home/
return unicode(text)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 271: ordinal not in range(128)
This is caused by the TALES engine trying to directly convert the OFS.Image.File object that represents a test table into unicode. Since File objects can never be unicode by definition, this is guaranteed to bork if there are accented chars in it.
The attached patch contains a test and a one-line work-around. Took me a minute to write the work-around, and the whole day for the test...
The work-around converts the OFS.Image.File to string first, giving the TALES unicode-
Related branches
- Tres Seaver: Pending requested
Changed in zelenium: | |
status: | New → Fix Committed |
assignee: | nobody → Tres Seaver (tseaver) |
Fix released with version 1.0.2:
http:// pypi.python. org/pypi/ Products. Zelenium/ 1.0.2