[Python-bugs-list] [ python-Bugs-606692 ] xml.sax second time file loading problem
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 09 Sep 2002 05:36:04 -0700
Bugs item #606692, was opened at 2002-09-09 14:36
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=606692&group_id=5470
Category: XML
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Adam Widera (adamwidera)
Assigned to: Nobody/Anonymous (nobody)
Summary: xml.sax second time file loading problem
Initial Comment:
Platform: windows 2000 SP2 (Pl)
Python version: Python 2.2 (#28, Dec 21 2001,
12:21:22) [MSC 32 bit (Intel)] on win32
I have noticed strange problem while using the xml.sax
module. When I run my application using python.exe
everything is working fine, the error occures only when I
try to execute my script using pythonw.exe.
The problematic code looks approximately like this (It's
a PyQT based application btw):
parser = xml.sax.make_parser()
handler = MyAppDocumentHandler()
parser.setContentHandler(handler)
try:
self.parser.parse(fileName)
except IOError:
QMessageBox.information(None,"MyApp","Sorry,
problems occured while loading:\n"+fileName+"\n\nIO
error:\n"+str(sys.exc_info()[1]))
return FALSE
except:
print "Unhandled exception:", sys.exc_info()[0]
QMessageBox.information(None,"MyApp","Sorry,
problems occured while
loading:\n"+fileName+"\n\nParser error:\n"+str
(sys.exc_info()[0]))
return FALSE
The first time when I open the file everything works ok,
the file is parsed, but when I try to open another file I
catch the IOError [Errno 9] Bad file descriptor error. (The
file location and everything else is ok.)
Greetings
Adam Widera
PS: If You have more questions about the bug or have
problems with trigging the bug out get me know. My e-
mail: adamwidera@wp.pl
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=606692&group_id=5470