[ python-Bugs-1071516 ] test_subprocess fails on cygwin

SourceForge.net noreply at sourceforge.net
Mon Dec 13 20:21:21 CET 2004


Bugs item #1071516, was opened at 2004-11-23 09:34
Message generated for change (Comment added) made by astrand
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1071516&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Jason Tishler (jlt63)
Summary: test_subprocess fails on cygwin

Initial Comment:
[10:29] $python -V
Python 2.4c1
[10:30] $
[10:31] $
[10:31] $python -c 'from test.test_subprocess import
test_main; test_main()' -v
test_args_string (test.test_subprocess.ProcessTestCase)
... ok
test_call_kwargs (test.test_subprocess.ProcessTestCase)
... ok
test_call_seq (test.test_subprocess.ProcessTestCase) ... ok
test_call_string (test.test_subprocess.ProcessTestCase)
... ok
test_communicate (test.test_subprocess.ProcessTestCase)
... ok
test_communicate_pipe_buf
(test.test_subprocess.ProcessTestCase) ... ok
test_communicate_returns
(test.test_subprocess.ProcessTestCase) ... ok
test_cwd (test.test_subprocess.ProcessTestCase) ... ok
test_env (test.test_subprocess.ProcessTestCase) ... ok
test_exceptions (test.test_subprocess.ProcessTestCase)
... ok
test_executable (test.test_subprocess.ProcessTestCase)
... ok
test_invalid_args
(test.test_subprocess.ProcessTestCase) ... ok
test_list2cmdline
(test.test_subprocess.ProcessTestCase) ... ok
test_no_leaking (test.test_subprocess.ProcessTestCase)
... ok
test_poll (test.test_subprocess.ProcessTestCase) ... ok
test_preexec (test.test_subprocess.ProcessTestCase) ... ok
test_run_abort (test.test_subprocess.ProcessTestCase)
... ok
test_shell_sequence
(test.test_subprocess.ProcessTestCase) ... ok
test_shell_string
(test.test_subprocess.ProcessTestCase) ... ok
test_stderr_filedes
(test.test_subprocess.ProcessTestCase) ... ok
test_stderr_fileobj
(test.test_subprocess.ProcessTestCase) ... ok
test_stderr_none (test.test_subprocess.ProcessTestCase)
... ok
test_stderr_pipe (test.test_subprocess.ProcessTestCase)
... ok
test_stdin_filedes
(test.test_subprocess.ProcessTestCase) ... ok
test_stdin_fileobj
(test.test_subprocess.ProcessTestCase) ... ok
test_stdin_none (test.test_subprocess.ProcessTestCase)
... ok
test_stdin_pipe (test.test_subprocess.ProcessTestCase)
... ok
test_stdout_filedes
(test.test_subprocess.ProcessTestCase) ... ok
test_stdout_fileobj
(test.test_subprocess.ProcessTestCase) ... ok
test_stdout_none (test.test_subprocess.ProcessTestCase)
...     this bit of output is from a test of stdout in
a different process ...
ok
test_stdout_pipe (test.test_subprocess.ProcessTestCase)
... ok
test_stdout_stderr_file
(test.test_subprocess.ProcessTestCase) ... ok
test_stdout_stderr_pipe
(test.test_subprocess.ProcessTestCase) ... FAIL
test_universal_newlines
(test.test_subprocess.ProcessTestCase) ... FAIL
test_universal_newlines_communicate
(test.test_subprocess.ProcessTestCase) ... ok
test_wait (test.test_subprocess.ProcessTestCase) ... ok
test_writes_before_communicate
(test.test_subprocess.ProcessTestCase) ... ok

======================================================================
FAIL: test_stdout_stderr_pipe
(test.test_subprocess.ProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/test/test_subprocess.py",
line 191, in test_stdout_stderr_pipe
    self.assertEqual(stripped, "appleorange")
AssertionError: 'apple' != 'appleorange'

======================================================================
FAIL: test_universal_newlines
(test.test_subprocess.ProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/test/test_subprocess.py",
line 312, in test_universal_newlines
    "line1\nline2\nline3\nline4\nline5\nline6")
AssertionError: 'line1\n' !=
'line1\nline2\nline3\nline4\nline5\nline6'

----------------------------------------------------------------------
Ran 37 tests in 109.478s

FAILED (failures=2)
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/lib/python2.4/test/test_subprocess.py",
line 548, in test_main
    test_support.run_unittest(ProcessTestCase)
  File "/usr/lib/python2.4/test/test_support.py", line
290, in run_unittest
    run_suite(suite, testclass)
  File "/usr/lib/python2.4/test/test_support.py", line
274, in run_suite
    raise TestFailed(msg)
test.test_support.TestFailed: errors occurred in
test.test_subprocess.ProcessTestCase


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

>Comment By: Peter Åstrand (astrand)
Date: 2004-12-13 20:21

Message:
Logged In: YES 
user_id=344921

I don't think gdb is necessary: we already know the problem:
newlib doesn't loop around read() until all data is read.
Some Cygwin people seems to think that this is not a bug,
but I don't agree. 

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

Comment By: Jason Tishler (jlt63)
Date: 2004-12-13 20:04

Message:
Logged In: YES 
user_id=86216

I will look into this problem and why test_shutil failed until
someone hacked the regression test so it passes under
Cygwin now.

Unfortunately, it may be a while before I find adequate time
to debug this problem. ;,(

Peter,

Since you have already devised a test case, would you be
willing to go to the next step and fire up gdb? Any help is
greatly appreciated. Thanks.

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

Comment By: Peter Åstrand (astrand)
Date: 2004-12-12 10:36

Message:
Logged In: YES 
user_id=344921

Reassigned to jlt63. 

See http://cygwin.com/ml/cygwin/2004-12/msg00135.html and
http://sources.redhat.com/ml/newlib/2004/msg00559.html for
details. 

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

Comment By: Andrew I MacIntyre (aimacintyre)
Date: 2004-12-12 10:05

Message:
Logged In: YES 
user_id=250749

As a Cygwin specific issue, I'd suggest reassigning the bug
to Jason Tishler (jlt63) who maintains the Cygwin port.

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

Comment By: Peter Åstrand (astrand)
Date: 2004-12-05 15:43

Message:
Logged In: YES 
user_id=344921

This seems to be a Cygwin bug: p.stdout.read() only returns
a partial result. Another p.stdout.read() is necessary to
retrieve all data. fileobject.read should return all data,
though. It doesn't, because fread() is behaving strange: It
returns a short read, but neither feof() nor ferror() is
set. This is wrong:

"Upon  successful  completion, fread() shall return the
number of elements successfully read which is less than
nitems only if a read error or end-of-file is encountered."

One strange thing is that this only happens if close-on-exec
is used for the error pipe. Perhaps a race condition. 

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

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


More information about the Python-bugs-list mailing list