Skip to main content

Pidfile featuring stale detection and file-locking, can also be used as context-manager

Project description

PidFile class featuring:

  • stale detection

  • pidfile locking (fcntl)

  • chmod (default is 0o644)

  • chown

  • custom exceptions

Context Manager

PidFile can be used as a context manager:

with PidFile():
  do_something()

Exception Order

In default mode PidFile will try to acquire a file lock before anything else. This means that normally you get a PidFileAlreadyLockedError instead of the PidFileAlreadyRunningError when running a program twice.

If you just want to know if a program is already running its easiest to use just PidFileError since it will capture all possible PidFile exceptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pid-1.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

pid-1.0.2-py2.py3-none-any.whl (4.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pid-1.0.2.tar.gz.

File metadata

  • Download URL: pid-1.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pid-1.0.2.tar.gz
Algorithm Hash digest
SHA256 b79a1ce586207f66d55214866f119e9195cb184db18aea9fd7ad3b148aaa3205
MD5 df2a6d606f97b5e8f5c6a80b013b4bf5
BLAKE2b-256 f4cd299516bd728d130656b6e5c29245f541d05d9a1b0c68e43e7c9c160cf5d9

See more details on using hashes here.

File details

Details for the file pid-1.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pid-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f58e29017d7a72d783d10ad03eb4fd9f69ff49bdc85de8b29977bc48adfa80b5
MD5 dbfcc7b47579502bdf609069287f6b78
BLAKE2b-256 a6369f2178c218680aff2dbddedec9d547ec46de21ba52cf0abd075167b60514

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page