A problem about File path encode

Kevien Lee ironpythonster at gmail.com
Tue Oct 10 03:14:55 CEST 2006

Hi everyone,
  There is a problem about File path encode ,when i want to parse an xml
  The code as follow:
from xml.dom import minidom
def ReadXml():
    print xmldoc.toxml()

if __name__ == "__main__":


there throw an error:

Traceback (most recent call last):
  File "D:/Downloads/test", line 8, in <module>
  File "D:/Downloads/test", line 4, in ReadXml
  File "D:\Program Files\Python25\lib\xml\dom\minidom.py", line 1913, in
    return expatbuilder.parse(file)
  File "D:\Program Files\Python25\lib\xml\dom\expatbuilder.py", line 922, in
    fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: 'D:\\Downloads\x01.xml'


See the red line.the file path"D:\Downloads\1.xml" auto  changed

I think may be the version cause the problem (version2.4) at the beginning,but
when i changed the version2.5 ,

the error still exist.and the code run on another PC is OK.Why this error
happen?how could i fix that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061010/de757c19/attachment.html>

More information about the Python-list mailing list