Skip to content

Tags: ourboy/ps_mem

Tags

v3.12

Verified

This commit was signed with the committer’s verified signature.
pixelb Pádraig Brady
add --version option

Also update versions and man page dates

v3.6

support pip install

Added MANIFEST.in to support:
  python setup.py sdist

Adjusted ps_mem.py to support separate ps_mem script,
while also installing the ps_mem.py module.
That's handled automatically by entry_points in setup.py

v3.5

support non latin1 command names in python3

Replace md5 checksums with build-in hash()
which avoids the encoding issue entirely,
and whose collision rate should be fine
for this application.

Test Setup:

  $ cp /bin/sleep slé😃p
  $ ./slé😃p inf &

Before:

  # python2 ./ps_mem.py | grep --only sl.*$
  slé😃p
  # python3 ./ps_mem.py | grep --only sl.*$
  digester.update(bytes(line,'latin1'))
    UnicodeEncodeError: 'latin-1' codec can't encode character '\U0001f603'
  # LC_ALL=C python2 ./ps_mem.py | grep --only sl.*$
  slé😃p
  # LC_ALL=C python3 ./ps_mem.py | grep --only sl.*$
  slp

After:

  # python2 ./ps_mem.py | grep --only sl.*$
  slé😃p
  # python3 ./ps_mem.py | grep --only sl.*$
  slé😃p
  # LC_ALL=C python2 ./ps_mem.py | grep --only sl.*$
  slé😃p
  # LC_ALL=C python3 ./ps_mem.py | grep --only sl.*$
  slp