Skip to content

Process.open_files fails if deleted files still visible #717

Closed
@skundrik

Description

os.readlink(file) can sometimes return path looking like this (^@ is NULL)

/home/testaccount/.logstash-forwarder^@^@^@^@ (deleted)
/home/testaccount/.logstash-forwarder^@new (deleted)

resulting in

TypeError: must be encoded string without NULL bytes, not str

when call to isfile_strict(file) is made. It seems to be happening every time I try to use open_files(proc).

Environment
OS: 2.6.18-164.10.1.el5 #1 SMP Wed Dec 30 18:35:28 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 17:02:03)
psutil 3.3.0

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions