[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 27ae1a476ef7 by Serhiy Storchaka in branch '3.4': Issue #22915: SAX parser now supports files opened with file descriptor or https://hg.python.org/cpython/rev/27ae1a476ef7 New changeset ce9881eecfb4 by Serhiy Storchaka in branch 'default': Issue

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Jocelyn, in both cases the argument of parse() is a file object with integer name. Tests use one of simplest way to create such object. -- resolution: - fixed stage: commit review - resolved status: open - closed

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-27 Thread Jocelyn
Jocelyn added the comment: Ok, I understand your tests now. Thanks for the fixes ! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___ ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This bug should be fixed in other place. Here is a patch. -- assignee: - serhiy.storchaka nosy: +christian.heimes, serhiy.storchaka stage: needs patch - patch review Added file: http://bugs.python.org/file37252/sax_non_str_file_name.patch

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-23 Thread R. David Murray
R. David Murray added the comment: Serhiy's patch looks correct to me. Given that if the source doesn't have a name attribute it is simply not set in the existing code, this change should be safe (backward compatible). Elsewhere the possibility was raised of converting the int to a string

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-23 Thread Jocelyn
Jocelyn added the comment: The only explicit documentation I found on SystemId is from the java specification (it is my understanding that python sax implementation is adapted from Java one): http://www.saxproject.org/apidoc/org/xml/sax/InputSource.html#setSystemId%28java.lang.String%29 The

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___ ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-22 Thread Avneesh Chadha
Changes by Avneesh Chadha avneesh.cha...@gmail.com: -- nosy: +Avneesh.Chadha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___ ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-22 Thread Jocelyn
Jocelyn added the comment: Here is a patch to add a test to test_sax.py. I'm not sure on the fix. Is the following one a correct one ? def prepareParser(self, source): if source.getSystemId() is not None: -self._parser.SetBase(source.getSystemId()) +

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-22 Thread Jocelyn
Jocelyn added the comment: Forgot to attach the testcase when opening the bug. -- Added file: http://bugs.python.org/file37250/toto.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-22 Thread R. David Murray
R. David Murray added the comment: Has anyone investigated what exactly sax uses SystemId/SetBase *for*? I think think we need that info in order to decide what to do, and I'm not familiar with sax. -- ___ Python tracker rep...@bugs.python.org

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-21 Thread Jocelyn
New submission from Jocelyn: With the attached code, and an xml file, I got the following error with python 3.4.2: $ cat toto.xml ?xml version='1.0' encoding='UTF-8'? test/test $ python3.4 toto.py Traceback (most recent call last): File toto.py, line 10, in module parse(proc.stdout,

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-21 Thread R. David Murray
R. David Murray added the comment: My guess is that this is similar to issue 21044. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-21 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22915 ___ ___

[issue22915] sax.parser cannot get xml data from a subprocess pipe

2014-11-21 Thread R. David Murray
R. David Murray added the comment: I've looked at the sax code, and this does indeed have the same root cause: in python2 a dummy string was used for the 'name' attribute of io objects that are based on file descriptors, whereas in python3 the name is the integer value of the file descriptor.