oschmod
Windows and Linux compatible chmod
What it is and what it does
oschmod bridges a critical gap: Python's os.chmod() silently fails on Windows, leaving file permissions unchanged while giving no warning or error. This package provides a cross-platform wrapper that translates chmod-style permissions (both symbolic like 'u+rwx' and octal like 0o700) into the underlying OS calls—using Windows security APIs on Windows, and standard POSIX chmod on Linux and macOS.
You can use it as a drop-in replacement for os.chmod() in your code, or invoke it from the command line with the familiar chmod syntax. It supports recursive permission changes with the -R flag and handles both individual file ownership and group-based permissions in a platform-consistent way.
Use it for:
- Securing configuration files or private keys on Windows with the same permission model you'd use on Linux.
- Writing deployment scripts that set consistent file permissions across development, staging, and production machines running different OSes.
- Building cross-platform tools that need to enforce read/write/execute restrictions without platform-specific branching logic.
- Migrating shell scripts that use chmod to Python while maintaining the same permission semantics on all platforms.
- Setting up CI/CD pipelines that manage file permissions identically on Windows agents and Unix-based runners.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sets file permissions consistently across Windows, Linux, and macOS using chmod-style syntax that actually works on Windows, where os.chmod() has no effect.
Yes, if you need cross-platform chmod on Windows and can accept an abandoned package. The code is stable (no known vulnerabilities, low install friction), and the problem it solves is real and unsolved by the standard library. However, verify that pywin32 remains compatible with your Windows version, and be aware that bugs or edge cases discovered after 2023 will not be fixed upstream.
Install
oschmod on PyPI
pip
pip install oschmoduv
uv add oschmodpoetry
poetry add oschmodInstalling oschmod
Before you install
Low install friction; pure Python wheel with a single runtime dependency (pywin32). However, the package is abandoned—last release was 2020-10-30 and last commit 2023-01-16, so no active maintenance or bug fixes.
License in practice
Apache Software License 2.0 is permissive; you can use, modify, and distribute oschmod freely in commercial or private projects with minimal restrictions.
Quickstart
pip install oschmod
import oschmod
oschmod.set_mode('myfile', 'u+rwx')
oschmod.set_mode('myfile', 0o700)
On Windows, requires pywin32 to be installed and functional; on Linux/macOS, relies on standard POSIX permission APIs.
Verify before relying
- Whether pywin32 dependency is reliably maintained and compatible with current Windows versions.
- Whether the package works correctly with modern Python versions beyond 3.8 (classifiers list only up to 3.8).
- Real-world compatibility with Windows ACLs and how symbolic/octal modes map to actual Windows security descriptors.
Package facts
| License | Apache Software License 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pywin32 |
| Maintenance | abandoned — 2,114 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 337,168/month — #7,452 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oschmod-0.3.12-py2.py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
path.pyProvides Path objects that wrap filesystem…
permissive · top 15,000 on PyPI
dry-rest-permissionsDefines rules-based permissions for Django REST…
permissive · top 15,000 on PyPI
pathProvides Path objects that wrap filesystem…
permissive · top 5,000 on PyPI
djangorestframework-guardianIntegrates django-guardian's object-level…
permissive · top 15,000 on PyPI
pathtoolsProvides pattern matching and utility functions…
permissive · top 15,000 on PyPI
exit-codesProvides platform-independent exit codes for…
permissive · top 15,000 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
win32-setctimeSets file creation time on Windows systems via…
permissive · top 5,000 on PyPI
doccmdRuns linters, formatters, and other…
permissive · top 15,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI