reubano / mezmorize

Memoization for python functions (based on Flask-Cache)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pgrep break windows

sottom opened this issue · comments

The pgrep command used on the line at the link below breaks when run on Windows. The error is:
FileNotFoundError: [WinError 2] The system cannot find the file specified

Find a system agnostic way of doing it (using straight python perhaps).

return any_env or call(['pgrep', process]) == 0

Idea: see if flask-caching does anything similar...

same here

Traceback (most recent call last):
  File "...\processors.py", line 9, in <module>
    from mezmorize import Cache
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\__init__.py", line 24, in <module>
    from . import backends
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\backends.py", line 22, in <module>
    from .utils import (
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\utils.py", line 101, in <module>
    HAS_REDIS = redis and pgrep('redis')
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\utils.py", line 96, in pgrep
    return any_env or call(['pgrep', process]) == 0
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified