mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use proper separators on windows
This commit is contained in:
parent
f0e6ead4c7
commit
5784d989f5
@ -6,7 +6,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
# resolving of SYSTEM entitties is turned off as entities can cause
|
# resolving of SYSTEM entities is turned off as entities can cause
|
||||||
# reads of local files, for example:
|
# reads of local files, for example:
|
||||||
# <!DOCTYPE foo [ <!ENTITY passwd SYSTEM "file:///etc/passwd" >]>
|
# <!DOCTYPE foo [ <!ENTITY passwd SYSTEM "file:///etc/passwd" >]>
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ def find_tests():
|
|||||||
|
|
||||||
def test_safe_xml_fromstring(self):
|
def test_safe_xml_fromstring(self):
|
||||||
templ = '''<!DOCTYPE foo [ <!ENTITY e {id} "{val}" > ]><r>&e;</r>'''
|
templ = '''<!DOCTYPE foo [ <!ENTITY e {id} "{val}" > ]><r>&e;</r>'''
|
||||||
external = 'file:///' + self.temp_file
|
external = 'file:///' + self.temp_file.replace(os.sep, '/')
|
||||||
self.assertEqual(etree.fromstring(templ.format(id='SYSTEM', val=external)).text, 'external')
|
self.assertEqual(etree.fromstring(templ.format(id='SYSTEM', val=external)).text, 'external')
|
||||||
for eid, val, expected in (
|
for eid, val, expected in (
|
||||||
('', 'normal entity', 'normal entity'),
|
('', 'normal entity', 'normal entity'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user