Message 161646 - Python tracker (original) (raw)

Here's my first pass at a patch. For this patch, I took the proposal to its logical extreme: I removed every function in os that was both mildly redundant with an existing function and has been added since 3.2, and moved that functionality to the equivalent existing function, making it accessible with the use of keyword-only parameters.

Specifically:

This function has been removed, and instead | this parameter has been added to | | this function | | | v v v

faccessat dir_fd access faccessat effective_ids access faccessat follow_symlinks access fchmodat dir_fd chmod fchmodat follow_symlinks chmod fchownat dir_fd chown fchownat follow_symlinks chown fexecve fd execve fgetxattr fd getxattr flistdir fd listdir flistxattr fd listxattr fremovexattr fd removexattr fsetxattr fd setxattr fstatat dir_fd stat futimens fd utime futimes fd utime futimesat dir_fd utime lgetxattr follow_symlinks getxattr linkat dst_dir_fd link linkat src_dir_fd link linkat follow_symlinks link llistxattr follow_symlinks listxattr lremovexattr follow_symlinks removexattr lsetxattr follow_symlinks setxattr lutimes follow_symlinks utime mkdirat dir_fd mkdir mkfifoat dir_fd mkfifoat mknodat dir_fd mknod open dir_fd openat readlinkat dir_fd readlink renameat dst_dir_fd rename renameat src_dir_fd rename symlinkat dir_fd symlink unlinkat dir_fd unlink unlinkat remove_directory unlink utimensat dir_fd utime utimensat follow_symlinks utime

Additionally, we could deprecate this function, | as I have added this parameter | | to this function: | | | v v v

fchdir fd chdir fchmod fd chmod fstat fd stat fstatvfs fd statvfs lchflags follow_symlinks chflags lchmod follow_symlinks chmod fchown fd chown lchown follow_symlinks chown lstat follow_symlinks stat

I doubt we'll ever deprecate those functions. This patch does not deprecate those functions. I don't propose deprecating those functions.

Notes:

I do think it's an improvement. But I won't check any part of it in without some consensus (or BFDL ruling).

I look forward to your feedback!