This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: xml.sax second time file loading problem
Type: Stage:
Components: XML Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: adamwidera, facundobatista, loewis
Priority: normal Keywords:

Created on 2002-09-09 12:36 by adamwidera, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (6)
msg12325 - (view) Author: Adam Widera (adamwidera) Date: 2002-09-09 12:36
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

msg12326 - (view) Author: Adam Widera (adamwidera) Date: 2002-09-09 13:07
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

msg12327 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-09-11 16:37
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.
msg12328 - (view) Author: Adam Widera (adamwidera) Date: 2002-09-12 17:23
Logged In: YES 
user_id=608362

Hi Martin

No. I'm affraid no. It happens even if it is the only one
and the first application that is running on the system
(except background ones). It is verry unpredictible, I have
tested it once again and I have noticed that the smaller and
verry simple xml files (2k) were loading without problems
and the the error occured only while loading the bigger ones
(37k). At the same time yesterday the problem occured while
loading smaller files too. Maybe it is a memory management
problem?

Greetings
Adam Widera
msg12329 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-11-16 00:38
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo
msg12330 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-03-21 18:32
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo
History
Date User Action Args
2022-04-10 16:05:40adminsetgithub: 37157
2002-09-09 12:36:04adamwideracreate