8000 Tags · giladro/ps_mem · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tags: giladro/ps_mem

Tags

v3.6

Toggle v3.6's commit message
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

Toggle v3.5's commit message
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
0