Issue544740
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2002-04-16 16:00 by jlt63, last changed 2022-04-10 16:05 by admin. This issue is now closed.
Files | ||||
---|---|---|---|---|
File name | Uploaded | Description | Edit | |
test_commands.py.diff | jlt63, 2002-08-27 18:12 | |||
commands.py.diff | jlt63, 2002-09-06 13:12 | |||
test_commands.py-2.diff | jlt63, 2002-09-27 20:01 |
Messages (11) | |||
---|---|---|---|
msg39603 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-04-16 16:00 | |
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. |
|||
msg39604 - (view) | Author: Neal Norwitz (nnorwitz) * | Date: 2002-08-11 15:48 | |
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. |
|||
msg39605 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-08-27 18:12 | |
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. |
|||
msg39606 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2002-09-02 14:14 | |
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"? |
|||
msg39607 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-09-06 13:12 | |
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? |
|||
msg39608 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2002-09-06 13:22 | |
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? |
|||
msg39609 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-09-06 13:41 | |
Logged In: YES user_id=86216 > I'm not sure what the purpose of getstatus is - > adding -n is a behaviour change, which should be > avoided. Agreed. AFAICT, nothing in the Python source except for test_commands.py itself is using commands.getstatus(). I verified this via: find Lib -name '*.py' | xargs fgrep getstatus Obviously, Python applications could be using commands.py. > 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? $ ls -ld / drwxr-xr-x 15 Administ Domain U 4096 Aug 12 12:50 / $ fgrep 'Domain U' /etc/group Domain Users:S-1-5-21-136257377-364972176-1563891627-513:10513: Note that "Domain U" is the truncated version of "Domain Users". |
|||
msg39610 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2002-09-22 08:33 | |
Logged In: YES user_id=21627 How about the regexp pat = r'''d......... # It is a directory. \s+\d+ # It has some number of links. [^/]* # Skip user, group, size, and date. /\. # and end with the name of the file. ''' If that works, please formulate it as a patch that lists (in a comment) a few possible outputs, so that anybody who wants to tighten the regexp has test cases. |
|||
msg39611 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-09-27 20:01 | |
Logged In: YES user_id=86216 I followed your advise. Is the latest patch OK? |
|||
msg39612 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2002-09-30 10:27 | |
Logged In: YES user_id=21627 That looks fine, please apply it. |
|||
msg39613 - (view) | Author: Jason Tishler (jlt63) * | Date: 2002-09-30 15:46 | |
Logged In: YES user_id=86216 Committed as Lib/test/test_commands.py 1.8. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-10 16:05:13 | admin | set | github: 36445 |
2002-04-16 16:00:57 | jlt63 | create |