[Python-bugs-list] [ python-Bugs-606692 ] xml.sax second time file loading problem

noreply@sourceforge.net noreply@sourceforge.net
Wed, 11 Sep 2002 09:37:29 -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



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-09-11 18:37

Message:
Logged In: YES 
user_id=21627

Is there any chance that when you run the application the
second time, that the first instance is still around? Please
use the process viewer to find out whether there are any
remaining Python processes - this could be a sharing violation.

----------------------------------------------------------------------

Comment By: Adam Widera (adamwidera)
Date: 2002-09-09 15:07

Message:
Logged In: YES 
user_id=608362

Platform: windows 2000 SP2 (Pl)
Python version: Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC
32 bit (Intel)] on win32

Correction to the previous bug message:
the 5'th line of the example should of course look like this:

parser.parse(fileName)

not

self.parser.parse(fileName)

The bug is still actual (the literal mistake took place only
in the bug report message)

Greetings
Adam Widera



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=606692&group_id=5470