[Common] Fix creation of pidfile via command option

Python 3 raises a TypeError for binary file mode and writing text string.

Fixes: #3278
This commit is contained in:
DjLegolas 2019-06-22 22:37:16 +03:00 committed by Calum Lind
parent 4b29436cd5
commit 1b4ac88ce7

View File

@ -325,7 +325,7 @@ class ArgParserBase(argparse.ArgumentParser):
# Write pid file before chuid
if options.pidfile:
with open(options.pidfile, 'wb') as _file:
with open(options.pidfile, 'w') as _file:
_file.write('%d\n' % os.getpid())
if not common.windows_check():