Patches item #1490190, was opened at 2006-05-17 13:45 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1490190&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Modules Group: Python 2.5 Status: Open Resolution: Accepted Priority: 5 Private: No Submitted By: M. Levinson (levinsm) Assigned to: Martin v. Löwis (loewis) Summary: add os.chflags() and os.lchflags() where available Initial Comment: The return value from os.stat() includes st_flags on some systems, but currently there's not much that can be done with the value; this patch aims to make st_flags useful by adding some associated constants to stat.py and the corresponding chflags() and lchflags() functions in posixmodule. For completeness, shutil.copystat() is also updated to call os.chflags() where it's available. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2007-03-21 17:46 Message: Logged In: YES user_id=21627 Originator: NO nnorwitz, can you please report whether the attached patch fixes it? File Added: chflags.diff ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2007-03-20 07:42 Message: Logged In: YES user_id=33168 Originator: NO It looks like Tru64 does have some version of chflags, however, it is undocumented and apparently causes python to exit. It is at least one of the reasons for the recent buildbot failures: http://python.org/dev/buildbot/all/alpha%20Tru64%205.1%20trunk/builds/1550/step-test/0 That doesn't really tell the whole story, but I logged on to the machine and ran the test, after modifying unittest to flush the stream, sigh :-( and got this: ringneck:/net/cci/nnorwitz/python/trunk.norwitz-tru64/nn-work-build % ./python -E -tt ./Lib/test/regrtest.py -v test_posix test_posix testNoArgFunctions (test.test_posix.PosixTester) ... ok test_access (test.test_posix.PosixTester) ... ok test_chdir (test.test_posix.PosixTester) ... ok test_chflags (test.test_posix.PosixTester) ... Bad system call ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2007-02-19 11:56 Message: Logged In: YES user_id=21627 Originator: NO Thanks for the patch. Committed as r53826. ---------------------------------------------------------------------- Comment By: M. Levinson (levinsm) Date: 2006-05-19 13:47 Message: Logged In: YES user_id=1522893 In addition to MacOS, chflags(2) is available on FreeBSD, OpenBSD, and NetBSD. The flags in Lib/stat.py are the full set of available values although, as you noted, MacOS hasn't (yet) implemented several of them. Thanks for the comments - I've attached an updated version of the patch incorporating your suggestions. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-05-19 09:31 Message: Logged In: YES user_id=33168 What operating systems is this available on? The only one I've found is OS X. The man page says it's from BSD 4.4. I tried on Linux of various flavors (4+), Solaris, and Tru64. None of them had chflags. I also could only find some of the flags in my sys/stat.h that were added to stat.py. stat.h didn't have UF_NOUNLINK, SF_NOUNLINK, SF_SNAPSHOT. As far as the patch itself, it looks good. There are a couple of changes if this should be accepted though: doc needs \versionadded{2.5}, I would prefer flags as the var name rather than i in posixmodule.c (btw you shouldn't need to init path). Also would need to update Misc/NEWS and ACKS if accepted. ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-05-17 16:24 Message: Logged In: YES user_id=849994 Patch looks good. Do we want to include it? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1490190&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches