lxml-3.5.0 on NetBSD 7.99.22 with python-3.4.3 in the default C locale fails two tests:
Doctest: xpathxslt.txt
======= ======= ======= ======= ======= ======= ======= ======= ======= =======
ERROR: test_etree_ parse_io_ error (lxml.tests. test_io. ETreeIOTestCase )
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Traceback (most recent call last):
File "/usr/pkg/ lib/python3. 4/unittest/ case.py" , line 58, in testPartExecutor
yield
File "/usr/pkg/ lib/python3. 4/unittest/ case.py" , line 577, in run
testMethod()
File "/disk/ 3/archive/ obj/textproc/ py-lxml/ work/lxml- 3.5.0/src/ lxml/tests/ test_io. py", line 276, in test_etree_ parse_io_ error
dn = tempfile. mkdtemp( prefix= dirnameRU)
File "/usr/pkg/ lib/python3. 4/tempfile. py", line 295, in mkdtemp
_os.mkdir(file, 0o700)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-18: ordinal not in range(128)
======= ======= ======= ======= ======= ======= ======= ======= ======= =======
ERROR: test_etree_ parse_io_ error (lxml.tests. test_io. ElementTreeIOTe stCase)
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Traceback (most recent call last):
File "/usr/pkg/ lib/python3. 4/unittest/ case.py" , line 58, in testPartExecutor
yield
File "/usr/pkg/ lib/python3. 4/unittest/ case.py" , line 577, in run
testMethod()
File "/disk/ 3/archive/ obj/textproc/ py-lxml/ work/lxml- 3.5.0/src/ lxml/tests/ test_io. py", line 276, in test_etree_ parse_io_ error
dn = tempfile. mkdtemp( prefix= dirnameRU)
File "/usr/pkg/ lib/python3. 4/tempfile. py", line 295, in mkdtemp
_os.mkdir(file, 0o700)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-18: ordinal not in range(128)
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1735 tests in 24.823s
````
If I understand the test correctly, it tries to convert a Russian string to an ASCII string (since the default C locale on NetBSD is ASCII) and fails, and that makes the test fail. In my understanding the test works on Linux because the default C locale is UTF-8 there and the conversion works.
I don't know what the test really wants to test. Please change this test to be more portable.