Skip to main content

As simple command line tool to convert error numbers (of C errno.h), http status codes and signal numbers to human readable strings or back zu numbers.

Project description

errno_converter & signal_converter & http_converter

As simple command line tool to convert error numbers (of C errno.h), signal numbers and HTTP-Status-Codes to human readable strings or back to numbers. This tool makes use of errno, signal and http module of Python 3.8 standard library (Python 3.8 added support for verbose signal descriptions).

Example usage of errno_converter:

$ errno_converter.py
./dev/errno_converter/errno_converter.py [-v] list|<errno-number>|<errno-name>

$ errno_converter.py ENOENT
2

$ errno_converter.py -v ENOENT
  2 - ENOENT         : No such file or directory

$ errno_converter.py 2
ENOENT

$ errno_converter.py -v 2
  2 - ENOENT         : No such file or directory

$ errno_converter.py ENOE
  2 - ENOENT
  8 - ENOEXEC

$ errno_converter.py -v ENOE
No errno matched the input 'ENOE' (module 'errno' has no attribute 'ENOE'). Try to match as re:
  2 - ENOENT         : No such file or directory
  8 - ENOEXEC        : Exec format error

$ errno_converter.py list
  1 - EPERM
  2 - ENOENT
…
130 - EOWNERDEAD
131 - ENOTRECOVERABLE

$ errno_converter.py -v list
  1 - EPERM          : Operation not permitted
  2 - ENOENT         : No such file or directory
…
130 - EOWNERDEAD     : Owner died
131 - ENOTRECOVERABLE: State not recoverable
invalids: {41, 58}

Example usage of signal_converter:

$ signal_converter.py
signal_converter.py [-v] list|<errno-number>|<errno-name>

$ signal_converter.py SIGINT
2

$ signal_converter.py -v SIGINT
  2 - SIGINT         : Interrupt

$ signal_converter.py 2
SIGINT

$ signal_converter.py -v 2
  2 - SIGINT         : Interrupt

$ signal_converter.py SIGIO.*
 29 - SIGIO
  6 - SIGIOT

~$ signal_converter.py -v SIGIO.*
No signal matched the input 'SIGIO.*' (module 'signal' has no attribute 'SIGIO.*'). Try to match as re:
 29 - SIGIO          : I/O possible
  6 - SIGIOT         : Aborted

$ signal_converter.py list
  1 - SIGHUP
  2 - SIGINT
…
 34 - SIGRTMIN
 64 - SIGRTMAX

$ signal_converter.py -v list
  1 - SIGHUP         : Hangup
  2 - SIGINT         : Interrupt
…
 34 - SIGRTMIN       : Real-time signal 0
 64 - SIGRTMAX       : Real-time signal 30
invalids: {16, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}

Example .bashrc alias:

alias signal_converter="python3 ~/errno_converter/signal_converter.py"
alias errno_converter="python3 ~/errno_converter/errno_converter.py"
alias http_converter="python3 ~/errno_converter/http_converter.py"

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

errno_converter-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

errno_converter-0.1.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file errno_converter-0.1.1.tar.gz.

File metadata

  • Download URL: errno_converter-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for errno_converter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a9d8db57660046a39c18b8d973421db82ab4fcfd562af74d3a14e4a9fa4ea7d3
MD5 5504f685fd5c93d5393daa7cb4f0492e
BLAKE2b-256 70163e5eb5eb1272c63149d806a34ac1641397a20a5d3922bfbb614455ec28d1

See more details on using hashes here.

File details

Details for the file errno_converter-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for errno_converter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d25e6478c1bec095d12413bfe324e656bf315eef831fd64aa36c2e6fa5bd7f9e
MD5 c92124082273af260bf7ede9894be4ba
BLAKE2b-256 3b3863b8016f704c0e18d6153a4cbebc6c6ad9b9d534fe14bd11e02ad3bcbc13

See more details on using hashes here.

Supported by

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