From 0e3f6c465181734181f2428b4a99429a82f3fc45 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 17 Apr 2023 01:01:44 +0200 Subject: fix #2238 if cwd() cannot be determined always return "" instead of None --- docs/index.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index 2a1c5b6a..6f0132d2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1180,9 +1180,10 @@ Process class .. method:: exe() - The process executable as an absolute path. - On some systems this may also be an empty string. - The return value is cached after first call. + The process executable as an absolute path. On some systems, if exe cannot + be determined for some internal reason (e.g. system process or path no + longer exists), this may be an empty string. The return value is cached + after first call. >>> import psutil >>> psutil.Process().exe() @@ -1281,7 +1282,9 @@ Process class .. method:: cwd() - The process current working directory as an absolute path. + The process current working directory as an absolute path. If cwd cannot be + determined for some internal reason (e.g. system process or directiory no + longer exists) it may return an empty string. .. versionchanged:: 5.6.4 added support for NetBSD -- cgit v1.2.1