[Patches] [ python-Patches-544740 ] test_commands test fails under Cygwin

noreply@sourceforge.net noreply@sourceforge.net
Fri, 06 Sep 2002 06:22:31 -0700


Patches item #544740, was opened at 2002-04-16 18:00
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=544740&group_id=5470

Category: Tests
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason Tishler (jlt63)
Assigned to: Martin v. Löwis (loewis)
Summary: test_commands test fails under Cygwin

Initial Comment:
The Python 2.2.1 test_commands regression test
fails under Cygwin 1.3.10 because the regular
expression is pickier now and because Cygwin can
have spaces in user and/or group names. See the
following for some more details:

http://cygwin.com/ml/cygwin/2002-04/msg00774.html

and a workaround.

I'm submitting this as a bug report instead of a
patch because I don't know the best way to fix
this issue.  Can test_commands use numeric IDs
instead of names?  Should I discuss this issue
on python-dev instead of here?

BTW, please add a "Test" category to the
available choices for Bugs.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2002-09-06 15:22

Message:
Logged In: YES 
user_id=21627

I'm not sure what the purpose of getstatus is - adding -n is
a behaviour change, which should be avoided.

I'm still not sure what the issue with spaces in group names
is. Can you report the output of the ls for your system?

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

Comment By: Jason Tishler (jlt63)
Date: 2002-09-06 15:12

Message:
Logged In: YES 
user_id=86216

> This patch won't work in other locales.

I was afraid of this.

> Why do you have to put an explicit format string
> for the date in there?

Because without the explicit date regular
expression, I could not figure out how to match
the user and group names with an arbitrary number
of embedded spaces.

> What specific change made the expression
> "pickier"?

I guess that "pickier" was a bad choice of words
-- I should have used "changed" instead.  The
original test used "ls -ld /bin/ls" which didn't
seem to (but could) trigger the failure.

JT> Can test_commands use numeric IDs instead of
JT> names?

What about changing commands.getstatus() to use
numeric IDs? Is the attached (new) patch more
acceptable?


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-09-02 16:14

Message:
Logged In: YES 
user_id=21627

This patch won't work in other locales. E.g. in de_DE, a
date might read

Mär 21 01:14

which won't match your regexp. Furthermore, recent GNU
fileutils format it as

2002-09-02 10:12

in non-C locales, which is even further away.

In theory, putting LC_ALL=C into the environment should
solve this, but it would be better to not rely on the date
formatting. Why do you have to put an explicit format string
for the date in there? What specific change made the
expression "pickier"? 


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

Comment By: Jason Tishler (jlt63)
Date: 2002-08-27 20:12

Message:
Logged In: YES 
user_id=86216

Attached is a patch to fix this problem.  As
suggested by Guido, I am proposing a "better"
regular expression.

Unfortunately, I had to make an assumption on the
date format in order to match the user and group
names regardless of the number of embedded spaces.
Is my date regular expression acceptable?  Will it
work in non US locales?

FWIW, I tested under Cygwin and Red Hat Linux 7.1
without any ill effects.


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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-08-11 17:48

Message:
Logged In: YES 
user_id=33168

Jason, I presume this is still a problem.  It probably would
be a good idea to discuss on python-dev.

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

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