dsoprea / PyInotify

An efficient and elegant inotify (Linux filesystem activity monitor) library for Python. Python 2 and 3 compatible.
GNU General Public License v2.0
242 stars 73 forks source link

safely parse DEBUG environment variable #93

Open luzfcb opened 3 years ago

luzfcb commented 3 years ago

This pull request adds a safer way to parse the DEBUG environment variable.

Instead of only support integers to represent a boolean value, now its supports:

True values are y, yes, t, true, on, and 1; False values are n, no, f, false, off, 0 and empty string. Raises ValueError if is anything else.

https://github.com/python/cpython/blob/3.9/Lib/distutils/util.py#L307-L320