INNER CODE UNIT · Python
try_write_file
phusion/passenger · src/helper-scripts/wsgi-loader.py:39
def try_write_file(path, contents):
try:
with open(path, 'w') as f:
f.write(contents)
except IOError as e:
logging.warn('Warning: unable to write to ' + path + ': ' + e.strerror)
def initialize_logging():
logging.basicConfig(
level = logging.WARNING,
format = "[ pid=%(process)d, time=%(asctime)s ]: %(message)s")
if hasattr(logging, 'captureWarnings'):
logging.captureWarnings(True)
def read_startup_arguments():
global options
work_dir = os.getenv('PASSENGER_SPAWN_WORK_DIR')