[Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_shutil.py, 1.10, 1.11 (original) (raw)
Michael Hudson mwh at python.net
Tue Dec 7 15:54:50 CET 2004
- Previous message: [Python-Dev] Re: long number multiplication
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_shutil.py, 1.10, 1.11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
jlgijsbers at users.sourceforge.net writes:
Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20531
Modified Files: testshutil.py Log Message: SF bug #1076467: don't run testonerror as root, as the permission errors don't get provoked that way. Also add a bunch of cross-references to bugs.
Index: testshutil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/testshutil.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- testshutil.py 23 Nov 2004 09:27:27 -0000 1.10 +++ testshutil.py 6 Dec 2004 20:50:15 -0000 1.11 @@ -16,7 +16,10 @@ filename = tempfile.mktemp() self.assertRaises(OSError, shutil.rmtree, filename) - if hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin': + # See bug #1071513 for why we don't run this on cygwin + # and bug #1076467 for why we don't run this as root. + if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin' + and os.getenv('USER') != 'root'):
Is that really the best way to check for root? It may be, I guess, but I'd have expected os.geteuid() to be more reliable...
Or is it os.getuid()? I always get confused by these functions...
Cheers, mwh
-- CDATA is not an integration strategy. -- from Twisted.Quotes
- Previous message: [Python-Dev] Re: long number multiplication
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_shutil.py, 1.10, 1.11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]