[Python-bugs-list] [ python-Bugs-456395 ] test_pty failure under IRIX

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Sep 2001 07:25:05 -0700


Bugs item #456395, was opened at 2001-08-28 21:42
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456395&group_id=5470

Category: None
Group: Platform-specific
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Andrew Dalke (dalke)
Assigned to: Guido van Rossum (gvanrossum)
Summary: test_pty failure under IRIX

Initial Comment:
Under IRIX 6.4 (which is at least two years old)
I get the following regression failure in test_pty.
It appears newlines are converted to "\r\n".  I
don't know enough about ptys to suggest a solution.

test_pty
The actual stdout doesn't match the expected stdout.
This much did match (between asterisk lines):
*******************************************************
***************
test_pty
*******************************************************
***************
Then ...
We expected (repr): 'I wish to buy a fish 
license.\nFor my pet fish, Eric.\n'
But instead we got: 'I wish to buy a fish 
license.\r\nFor my pet fish, Eric.\n'
test test_pty failed -- Writing: 'I wish to buy a fish 
license.\r\nFor my pet fish
, Eric.\n', expected: 'I wish to buy a fish 
license.\nFor my pet fish, Eric.\n'

          Andrew
          dalke@dalkescientific.com


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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-11 07:25

Message:
Logged In: YES 
user_id=6380

OK.  Closed again.

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

Comment By: Sjoerd Mullender (sjoerd)
Date: 2001-09-11 06:33

Message:
Logged In: YES 
user_id=43607

The patch does the trick.  The test no longer fails.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-11 06:09

Message:
Logged In: YES 
user_id=6380

Oops.

Can you try the attached patch?

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

Comment By: Sjoerd Mullender (sjoerd)
Date: 2001-09-11 01:03

Message:
Logged In: YES 
user_id=43607

I am reopening this bug.
In the current  version of Python, with a current version of
IRIX (6.5.13), the test still fails.  If you look closely at
the output and compare it with the comment and code in the
test file, you can see why:
The output that the test got was 'I wish to buy a fish
license.\r\nFor my pet fish, Eric.\n'.  The test removes a
final \r\n and replaces it with just \n before comparing
(the result is shown above), but it doesn't do that for
embedded \r\n, and that is what is wrong with the output.
I suggest changing the lines
if s1[-2:] == "\r\n":
    s1 = s1[:-2] + "\n"
to something like
s1 = string.join(string.split(s1, '\r\n'), '\n')
(or s1 = '\n'.join(s1.split('\r\n')) ).

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-10 08:12

Message:
Logged In: YES 
user_id=6380

No followup. Closed as Fixed.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-05 12:04

Message:
Logged In: YES 
user_id=6380

Andrew, which Python version did you use?

The current CVS version has this comment somewhere in its
CVS log, suggesting that this might be fixed in CVS:

Allow the process of reading back what we wrote to a pty to
transform linefeeds into carriagereturn-linefeeds (which is
apparently what IRIX does.) 


So I'm tempted to close this as Fixed in CVS.

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

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