Bugs #544740: test_commands test fails under Cygwin

Neil Norwitz suggested that I discuss the following on python-dev: http://sourceforge.net/tracker/?func=detail&aid=544740&group_id=5470&atid=105470 The problem is that test_commands does not handle spaces in either user or group names. Although this is probably only an issue under Cygwin, this could affect other Unixes too (yup, I'm clutching at straws). Anyway, suggestions on how to fix this will be greatly appreciated. Thanks, Jason

The obvious fix would be a better regular expression. Please submit a patch. --Guido van Rossum (home page: http://www.python.org/~guido/)

On Tue, Aug 13, 2002 at 09:08:53AM -0400, Guido van Rossum wrote:
Anyway, suggestions on how to fix this will be greatly appreciated.
The obvious fix would be a better regular expression.
I thought of that before I submitted my bug report. Unfortunately, deriving the better regular expression is not obvious. The following is what I have come up with: pat = r'''d......... # directory \s+\d+ # number of links (\s+\w+)+ # user and group which can contain spaces \s+\d+ # size ***> \s+\w+\s+\d+\s+[\d:]+ # date <*** \s+/\. # file name ''' 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?
Please submit a patch.
I will do so, once I get some feedback. Thanks, Jason

The obvious fix would be a better regular expression. Please submit a patch. --Guido van Rossum (home page: http://www.python.org/~guido/)

On Tue, Aug 13, 2002 at 09:08:53AM -0400, Guido van Rossum wrote:
Anyway, suggestions on how to fix this will be greatly appreciated.
The obvious fix would be a better regular expression.
I thought of that before I submitted my bug report. Unfortunately, deriving the better regular expression is not obvious. The following is what I have come up with: pat = r'''d......... # directory \s+\d+ # number of links (\s+\w+)+ # user and group which can contain spaces \s+\d+ # size ***> \s+\w+\s+\d+\s+[\d:]+ # date <*** \s+/\. # file name ''' 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?
Please submit a patch.
I will do so, once I get some feedback. Thanks, Jason
participants (2)
-
Guido van Rossum
-
Jason Tishler