X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;h=50d026924cf83302e0d39ff471a588730531a643;hp=8f6630f8b05e83a28329dd316336d2093b851462;hb=a070bffc3f4f6f21232c2349805b0a208d7b4cbf;hpb=710db132b0f10fee3897e581b190660e22b0b950 diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 8f6630f..50d0269 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -2442,9 +2442,8 @@ def daemonize(universe): if universe.contents["internal:process"].getboolean("daemon"): # if possible, we want to rename the process to the same as the script - # (these will need to be byte type during 2to3 migration) - new_argv = "\0".join(sys.argv) + "\0" - new_short_argv0 = os.path.basename(sys.argv[0]) + "\0" + new_argv = b"\x00".join(x.encode("utf-8") for x in sys.argv) + b"\x00" + short_argv0 = os.path.basename(sys.argv[0]).encode("utf-8") + b"\x00" # attempt the linux way first try: @@ -2463,7 +2462,7 @@ def daemonize(universe): ctypes.memmove(argc.contents, new_argv, len(new_argv)) ctypes.CDLL(ctypes.util.find_library("c")).prctl( 15, - new_short_argv0, + short_argv0, 0, 0, 0