#12777 closed defect (wontfix)
Functional tests fail with lxml 3.7.3 and twill 1.8: lxml.etree.XMLSyntaxError
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
TracDev/FunctionalTests#Windowsspecificdependencies points out:
For lxml, the latest version is not always easy-installable for Windows, so you will have to download a somewhat older version from PyPI:
But pip install lxml==2.3 fails, while pip install lxml successfully installs lxml 3.7.3.
But then (with twill 1.8) functional tests fail:
C:\Trac>python trac\tests\functional\__init__.py
Traceback (most recent call last):
File "trac\tests\functional\__init__.py", line 224, in <module>
unittest.main(defaultTest='test_suite')
File "c:\Python27\Lib\unittest\main.py", line 95, in __init__
self.runTests()
File "c:\Python27\Lib\unittest\main.py", line 232, in runTests
self.result = testRunner.run(self.test)
File "c:\Python27\Lib\unittest\runner.py", line 151, in run
test(result)
File "c:\Python27\Lib\unittest\suite.py", line 70, in __call__
return self.run(*args, **kwds)
File "c:\Python27\Lib\unittest\suite.py", line 108, in run
test(result)
File "c:\Python27\Lib\unittest\suite.py", line 70, in __call__
return self.run(*args, **kwds)
File "C:\Trac\trac\test.py", line 254, in run
self.setUp()
File "trac\tests\functional\__init__.py", line 151, in setUp
self._tester = self.tester_class(baseurl)
File "C:\Trac\trac\tests\functional\tester.py", line 45, in __init__
self.login('admin')
File "C:\Trac\trac\tests\functional\tester.py", line 53, in login
tc.follow(r"\bLogin\b")
File "C:\Python27\lib\site-packages\twill\commands.py", line 195, in follow
browser.follow_link(link)
File "C:\Python27\lib\site-packages\twill\browser.py", line 152, in follow_link
self._journey('follow_link', link)
File "C:\Python27\lib\site-packages\twill\browser.py", line 515, in _journey
r = self._follow_redirections(r, self._session)
File "C:\Python27\lib\site-packages\twill\browser.py", line 469, in _follow_redirections
redirected, url = self._test_for_meta_redirections(r)
File "C:\Python27\lib\site-packages\twill\browser.py", line 445, in _test_for_meta_redirections
html_tree = html.fromstring(r.text)
File "C:\Python27\lib\site-packages\lxml\html\__init__.py", line 876, in fromstring
doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
File "C:\Python27\lib\site-packages\lxml\html\__init__.py", line 762, in document_fromstring
value = etree.fromstring(html, parser, **kw)
File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src\lxml\lxml.etree.c:79010)
File "src/lxml/parser.pxi", line 1848, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:118341)
File "src/lxml/parser.pxi", line 1729, in lxml.etree._parseDoc (src\lxml\lxml.etree.c:116899)
File "src/lxml/parser.pxi", line 1063, in lxml.etree._BaseParser._parseUnicodeDoc (src\lxml\lxml.etree.c:110886)
File "src/lxml/parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:105109)
File "src/lxml/parser.pxi", line 706, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:106817)
File "src/lxml/parser.pxi", line 646, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:105963)
File "<string>", line 0
lxml.etree.XMLSyntaxError
In html_tree = html.fromstring(r.text) the parameter r.text is the empty string ''.
C:\Trac>python.exe
>>> import lxml.html
>>> lxml.html.fromstring('')
...
lxml.etree.XMLSyntaxError
With pip install twill==0.9.1 it works.
Attachments (0)
Change History (5)
comment:1 by , 9 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
comment:2 by , 9 years ago
Added twill==0.9.1 in TracDev/FunctionalTests@20. See also trunk/.travis.yml@15409.
comment:3 by , 9 years ago
Replying to 匿名:
TracDev/FunctionalTests#Windowsspecificdependencies points out:
For lxml, the latest version is not always easy-installable for Windows, so you will have to download a somewhat older version from PyPI:
But
pip install lxml==2.3fails, whilepip install lxmlsuccessfully installs lxml 3.7.3.
That page says that you will have to download a somewhat older version from PyPI. Not using pip.
comment:4 by , 9 years ago
Sorry I edited TracDev/FunctionalTests@21 before noticing your reply. Why not using pip? What should be done with the downloaded older version? Must easy-install from local egg be used?
comment:5 by , 9 years ago
You can use pip as far as I'm aware. Just use a version specifier: pip install twill==0.9.1.



twill 1.8 is broken. See [14792] (#11642)