[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks, Andrew! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: Close the issue. Thanks, Chris. It was the real regression, 3.2 works fine. See also #15649 for accepting str if not universal_newlines. -- ___ Python tracker

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 839bd8f98539 by Andrew Svetlov in branch '3.2': Add test to explicit check the absence regression in subprocess (issue #15592). http://hg.python.org/cpython/rev/839bd8f98539 New changeset 9d86480cc177 by Andrew Svetlov in branch 'default': Issue #15

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: Attaching patch. -- stage: needs patch -> patch review Added file: http://bugs.python.org/file26788/issue-15592-1.patch ___ Python tracker ___ _

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- stage: test needed -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: Attaching a failing test case. Also, to confirm, this issue does not seem to affect 3.2. -- keywords: +patch Added file: http://bugs.python.org/file26787/failing-test-case-1.patch ___ Python tracker

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I like to accept both str and bytes if universal_newlines is False and raise explicit exception for bytes if universal_newlines is True. Looks like universal_newlines for bytes doesn't make sense, also we prefer to use str everywhere. Bytes should be used if i

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: This issue may be the bug referenced here: # BUG: can't give a non-empty stdin because it breaks both the # select- and poll-based communicate() implementations. (stdout, stderr) = p.communicate() http://hg.python.org/cpython/file/843e0da7e91f/Lib/test/test_sub

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: > From my perspective input should be encoded (converted to bytes) if it is str > regardless of universal_newlines value. I don't know the reason, but the limitation is documented: "The optional input argument should be data to be sent to the child process, or

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: _communicate_with_select has the same problem as _communicate_with_poll. I don't understand why input has encoded if universal_newlines and passed unchanged otherwise. >From my perspective input should be encoded (converted to bytes) if it is str >regardless

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: See issue 12623 for another issue related to communicate() and universal newline support. -- nosy: +pitrou ___ Python tracker ___ _

[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-08 Thread Chris Jerdonek
New submission from Chris Jerdonek: Popen.communicate() raises an exception if passed no input when stdin=PIPE and universal_newlines=True. With universal_newlines=False, no exception is raised. For example, the following yields-- args = [sys.executable, '-c', 'pass'] popen = Popen(args, un