[Bug 1399916] Re: /just/in/case:-)

Roman Odaisky 1399916 at bugs.launchpad.net
Thu Dec 11 18:25:58 UTC 2014


In case there’s another right parenthesis from the process name.
str.partition would get the first parenthesis while rpartition would get
the last one, which is guaranteed to be the right one (no pun intended
:−). Unlikely but why not play it safe when possible. ps does the same.

See for yourself:

ln -s /usr/bin/python xyzzy:-\)plugh
./xyzzy:-\)plugh <<E
statline = open("/proc/self/stat").read()
print(statline)
print("Parent PID is not " + statline.partition(")")[2].split()[1])
print("But rather " + statline.rpartition(")")[2].split()[1])
E

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/1399916

Title:
  /just/in/case:-)

Status in ubuntu-release-upgrader package in Ubuntu:
  Triaged

Bug description:
  Just in case process name in /proc/%s/stat contains the right
  parenthesis character.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1399916/+subscriptions



More information about the foundations-bugs mailing list