Cannot write xml file when certain characters appear in the path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
Prehistory: Recently there was a bug filed in our project (Bug #744337), where somebody had problem so export some songs.
I tried to reproduce this, which I finally could:
It seems that, lxml cannot save a xml file to directory which contains characters like "ĉûüë" (see test script). But opening a file and passing the file object in my_tree.write() works.
Traceback (most recent call last):
File "Z:\test.py", line 31, in <module>
save_
File "Z:\test.py", line 26, in save_to_file
encoding=
File "lxml.etree.pyx", line 1850, in lxml.etree.
File "serializer.pxi", line 455, in lxml.etree.
IOError: [Errno 2] No such file or directory
However, I was not able to reproduce this on my Linux Box, but on windows.
I'll attach a small script to reproduce this.
The requested information (windows XP):
Python : sys.version_
lxml.etree : (2, 3, -99, 0)
libxml used : (2, 7, 7)
libxml compiled : (2, 7, 7)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
Cheers
(If you need further information, please ask for them!)
Note: This also occurs when opening a file with such a path. (If you want me to open another bug report, please let me know).
from lxml import etree (remove_ blank_text= True) file_path, parser)
parser = etree.XMLParser
parsed_file = etree.parse(