[issue2501] xml.sax.parser() doesn't terminate when given a filename

2012-08-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
Removed message: http://bugs.python.org/msg168983

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a831a0a29c4 by Nick Coghlan in branch 'default':
Close #2501: Permission bits are once again correctly copied from the source 
file to the cached bytecode file. Test by Eric Snow.
http://hg.python.org/cpython/rev/3a831a0a29c4

--
nosy: +python-dev
stage:  -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-09-03 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Applied in r66203.

--
resolution: accepted -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-09-03 Thread Barry A. Warsaw

Barry A. Warsaw <[EMAIL PROTECTED]> added the comment:

Benjamin will commit this.

--
assignee:  -> benjamin.peterson
nosy: +barry
resolution:  -> accepted

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-09-01 Thread Daniel Diniz

Daniel Diniz <[EMAIL PROTECTED]> added the comment:

Looks like this is a duplicate of issue3590, so this patch fixes two
release blockers ;)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-09-01 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

The patch looks great. (I love enabling disabled tests!)

--
keywords:  -needs review
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-08-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I've a better idea:


while buffer: 

It's faster and works for both empty bytes and str.

The patch fixes the issue and re-enables three unit tests.

--
keywords: +needs review, patch
Added file: http://bugs.python.org/file11295/xmlreader_buffer.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-08-28 Thread Daniel Diniz

Daniel Diniz <[EMAIL PROTECTED]> added the comment:

ISTM that this release blocker can be solved by changing
xml.sax.xmlreader.py line 122 from:
while buffer != "":
to
while buffer != b"":

--
nosy: +ajaksu2

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-08-21 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
priority: critical -> release blocker

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-03-28 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I had to disable three unit tests in test_sax. We didn't noticed the
problem before because the tests weren't actually run. The three tests
are marked clearly with XXX and FIXME.

--
nosy: +tiran
priority:  -> critical

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-03-28 Thread Mark Summerfield

New submission from Mark Summerfield <[EMAIL PROTECTED]>:

The tiny program at the end of this message runs under Python 2.5 &
30a3. Under 2 it gives the following output:

: python sax.py test.xml
('+', u'document')
('+', u'outer')
('+', u'inner')
('-', u'inner')
('-', u'outer')
('-', u'document')
Done

Under 3 it does not terminate:
: python3 sax.py test.xml
+ document
+ outer
+ inner
- inner
- outer
- document
Traceback (most recent call last):
  File "sax.py", line 19, in 
parser.parse(sys.argv[1])
  File "/home/mark/opt/python30a3/lib/python3.0/xml/sax/expatreader.py",
line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
  File "/home/mark/opt/python30a3/lib/python3.0/xml/sax/xmlreader.py",
line 124, in parse
buffer = file.read(self._bufsize)
  File "/home/mark/opt/python30a3/lib/python3.0/io.py", line 774, in read
current = self.raw.read(to_read)
KeyboardInterrupt

The xml.sax.parser() function seems to work fine if you give it an open
file object and close the file after the call. But the documentation
says you can give it a filename, but if you do that the parser does not
terminate in Python 3 although it works fine in Python 2.

# sax.py
import sys
import xml.sax
BUG = True
class SaxHandler(xml.sax.handler.ContentHandler):
def startElement(self, name, attributes):
print("+", name)
def endElement(self, name):
print("-", name)
handler = SaxHandler()
parser = xml.sax.make_parser()
parser.setContentHandler(handler)
if BUG:
parser.parse(sys.argv[1])
else:
fh = open(sys.argv[1], encoding="utf8")
parser.parse(fh)
fh.close()
print("Done")
# end of sax.py

Here is the test file:









--
components: XML
messages: 64625
nosy: mark
severity: normal
status: open
title: xml.sax.parser() doesn't terminate when given a filename
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com