[cx-freeze-users] Problem reading xml file
Brought to you by:
atuining
From: Smith, J. <js...@me...> - 2004-10-07 13:50:53
|
The following script works fine on both Linux and Windows when unfrozen and it works on Linux after being frozen but it does not work on Windows after freezing. FreezePython 3.0 Test script (xmltest.py): import xml.dom.minidom xmldoc =3D xml.dom.minidom.parse('xml.txt') for item in xmldoc.getElementsByTagName('item'): name =3D item.getAttribute('name') print name Required Data File (xml.txt): <?xml version=3D"1.0" ?> <items> <item name=3D"item1"> <part>part</part> </item> <item name=3D"item2"> <part>part</part> </item> <item name=3D"item3"> <part>part</part> </item> </items> Good output: item1 item2 Item3 Frozen Windows output: Traceback (most recent call last): File "w:\devtools\win32\prod\bin\initscripts\console.py", line 23, in ? exec code in m.__dict__ File "xmltest.py", line 5, in ? LookupError: unknown encoding: cp437 Freeze output: FreezePython --target-dir=3Dxtest xmltest.py Name File ---- ---- m StringIO C:\Python23\Lib\StringIO.py m UserDict C:\Python23\Lib\UserDict.py m __builtin__ m __main__ xmltest.py m _codecs m _random m _socket C:\Python23\DLLs\_socket.pyd m _sre C:\Python23\DLLs\_sre.pyd m _ssl C:\Python23\DLLs\_ssl.pyd m _weakref m _winreg C:\Python23\DLLs\_winreg.pyd m array m base64 C:\Python23\Lib\base64.py m binascii m cStringIO m codecs C:\Python23\Lib\codecs.py m copy C:\Python23\Lib\copy.py m copy_reg C:\Python23\Lib\copy_reg.py m cx_Freeze__init__ w:\devtools\win32\prod\bin\initscripts\console.py m dis C:\Python23\Lib\dis.py m dummy_thread C:\Python23\Lib\dummy_thread.py P encodings C:\Python23\Lib\encodings\__init__.py m encodings.aliases C:\Python23\Lib\encodings\aliases.py m errno m exceptions m ftplib C:\Python23\Lib\ftplib.py m getopt C:\Python23\Lib\getopt.py m getpass C:\Python23\Lib\getpass.py m gopherlib C:\Python23\Lib\gopherlib.py m httplib C:\Python23\Lib\httplib.py m imp m inspect C:\Python23\Lib\inspect.py m linecache C:\Python23\Lib\linecache.py m macpath C:\Python23\Lib\macpath.py m macurl2path C:\Python23\Lib\macurl2path.py m math m md5 m mimetools C:\Python23\Lib\mimetools.py m mimetypes C:\Python23\Lib\mimetypes.py m msvcrt m nt m ntpath C:\Python23\Lib\ntpath.py m nturl2path C:\Python23\Lib\nturl2path.py m opcode C:\Python23\Lib\opcode.py m os C:\Python23\Lib\os.py m os2emxpath C:\Python23\Lib\os2emxpath.py m popen2 C:\Python23\Lib\popen2.py m posixpath C:\Python23\Lib\posixpath.py m pyexpat C:\Python23\DLLs\pyexpat.pyd m quopri C:\Python23\Lib\quopri.py m random C:\Python23\Lib\random.py m re C:\Python23\Lib\re.py m repr C:\Python23\Lib\repr.py m rfc822 C:\Python23\Lib\rfc822.py m sha m socket C:\Python23\Lib\socket.py m sre C:\Python23\Lib\sre.py m sre_compile C:\Python23\Lib\sre_compile.py m sre_constants C:\Python23\Lib\sre_constants.py m sre_parse C:\Python23\Lib\sre_parse.py m stat C:\Python23\Lib\stat.py m string C:\Python23\Lib\string.py m strop m sys m tempfile C:\Python23\Lib\tempfile.py m thread m time m token C:\Python23\Lib\token.py m tokenize C:\Python23\Lib\tokenize.py m traceback C:\Python23\Lib\traceback.py m types C:\Python23\Lib\types.py m urllib C:\Python23\Lib\urllib.py m urllib2 C:\Python23\Lib\urllib2.py m urlparse C:\Python23\Lib\urlparse.py m uu C:\Python23\Lib\uu.py m warnings C:\Python23\Lib\warnings.py m weakref C:\Python23\Lib\weakref.py P xml C:\Python23\Lib\xml\__init__.py P xml.dom C:\Python23\Lib\xml\dom\__init__.py m xml.dom.NodeFilter C:\Python23\Lib\xml\dom\NodeFilter.py m xml.dom.domreg C:\Python23\Lib\xml\dom\domreg.py m xml.dom.expatbuilder C:\Python23\Lib\xml\dom\expatbuilder.py m xml.dom.minicompat C:\Python23\Lib\xml\dom\minicompat.py m xml.dom.minidom C:\Python23\Lib\xml\dom\minidom.py m xml.dom.pulldom C:\Python23\Lib\xml\dom\pulldom.py m xml.dom.xmlbuilder C:\Python23\Lib\xml\dom\xmlbuilder.py P xml.parsers C:\Python23\Lib\xml\parsers\__init__.py m xml.parsers.expat C:\Python23\Lib\xml\parsers\expat.py P xml.sax C:\Python23\Lib\xml\sax\__init__.py m xml.sax._exceptions C:\Python23\Lib\xml\sax\_exceptions.py m xml.sax.expatreader C:\Python23\Lib\xml\sax\expatreader.py m xml.sax.handler C:\Python23\Lib\xml\sax\handler.py m xml.sax.saxutils C:\Python23\Lib\xml\sax\saxutils.py m xml.sax.xmlreader C:\Python23\Lib\xml\sax\xmlreader.py m zipimport Missing modules: ? Carbon.File imported from macpath ? Carbon.Folder imported from tempfile ? Carbon.Folders imported from tempfile ? EasyDialogs imported from getpass ? SOCKS imported from ftplib ? _xmlplus imported from xml ? ce imported from os ? fcntl imported from tempfile ? ic imported from urllib ? java.lang imported from xml.sax._exceptions ? mac imported from os ? org.python.core imported from copy, xml.sax ? os.path imported from os ? os2 imported from os ? posix imported from os ? pwd imported from getpass, posixpath ? riscos imported from os ? riscosenviron imported from os ? riscospath imported from os ? rourl2path imported from urllib ? termios imported from getpass Copying C:\Python23\DLLs\_ssl.pyd Copying C:\Python23\DLLs\_sre.pyd Copying C:\WINDOWS\System32\python23.dll Copying C:\Python23\DLLs\_socket.pyd Copying C:\Python23\DLLs\pyexpat.pyd Copying C:\Python23\DLLs\_winreg.pyd Frozen binary xtest\xmltest.exe created. Done. |