skillfed

oschmod

Windows and Linux compatible chmod

oschmod v0.3.12 337.2K downloads/30d#7,452 on PyPI25
Permissive license Apache Software License 2.0 Abandoned released

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 oschmod

uv

uv add oschmod

poetry

poetry add oschmod

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Utilities

Tags

cross-platform file permissionschmod for windowsset file permissions all platformswindows file mode bitsportable chmod implementationsymbolic file permissionsoctal mode cross-platform
cross-platformfile-permissionswindows-compat

More Utilities packages