As Antoine noted in #14626, the "rmdir" argument to os.unlink doesn't really make sense since we already deviate from just mapping posix functionality one-on-one. Attached is a patch removing "rmdir" from os.unlink, and instead adding "dir_fd" to os.rmdir.
I think it's a good idea, and I didn't spot anything on my first pass at reviewing the patch. But I'm on my way out the door and won't be back for a few hours. Tell you what: once I'm back, if I don't spot anything out of place, I'll just check it in. If I have feedback I'll file a second patch. Work for you, Georg? (p.s. Antoine, Georg, anybody, if you have any more bright ideas like this, I'd love to hear 'em. But... now's the time.)
I made two documentation changes to the patch before committing it: * I restored the text under os.remove about how it doesn't handle directories. * I added a Misc/NEWS entry. But I didn't have to touch the code--that looked dead-on to me. Proper job, Georg!
History
Date
User
Action
Args
2022-04-11 14:57:31
admin
set
github: 59359
2012-06-23 23:58:06
larry
set
status: open -> closedresolution: fixedstage: patch review -> resolved