GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — gh-86533: Restore os.makedirs() ability to apply *mode* recursively by ZackerySpytz · Pull Request #23901 · python/cpython Conversation
|
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It is not stale. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ZackerySpytz is there any workaround for this at the moment as you stated in #42367 that umask can't be used to control the intermediate directory creation permissions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Defends against certain forms of local privilege escalation, i.e. understood to be defense in depth rather than a security issue given the recommended ways of deploying (docker container or in a single-use single-server) Fix #174 See python/cpython#23901
- Replace recursive_mode with more intuitive parent_mode parameter - parent_mode=None (default): intermediate dirs use default permissions - parent_mode=<mode>: intermediate dirs use specified permissions - parent_mode=mode: matches Python 3.6 behavior - Update documentation with version markers and usage examples - Add comprehensive test coverage with separate focused test functions - Fix test permissions to avoid cleanup issues (0o555 → 0o705) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add parent_mode parameter to Path.mkdir() for specifying intermediate directory permissions when parents=True - Maintain pathlib's independence by using recursive implementation rather than delegating to os.makedirs - Add comprehensive tests including umask behavior verification - Update documentation and whatsnew entries - Provides consistency with os.makedirs parent_mode parameter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
3cc6495 to
67ae3af
Compare
Use st_mode & 0o777 masking instead of stat.S_IMODE() to ignore filesystem-specific bits like setgid, matching the approach used in os.makedirs tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Defends against certain forms of local privilege escalation, i.e. understood to be defense in depth rather than a security issue given the recommended ways of deploying (docker container or in a single-use single-server) Fix #174 See python/cpython#23901
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hello, @gpshead. I see that you have made some changes to this PR. I have pointed out some lines in the changes you have made that we should modify.
We should also make sure that the lines in the new pathlib code are limited to a maximum of 79 characters (for PEP 8 compliance).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Zackery Spytz <[email protected]>
Co-authored-by: Zackery Spytz <[email protected]>
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
replaced by #150011 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.