Skip to content

Commit

Permalink
don't fail upon error while chdir()ing *before* loading config
Browse files Browse the repository at this point in the history
  • Loading branch information
svmhdvn committed Jul 9, 2024
1 parent 79b9a52 commit 2e0dcce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gunicorn/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ def load_config(self):
cfg = self.init(parser, args, args.args)

# set up import paths and follow symlinks
self.chdir()
try:
self.chdir()
except Exception as e:
msg = "Warning: failed to chdir to default path '%s'" \
" before loading config: %s\n" \
"Continuing with current working directory." \
% (sys.cfg.chdir, e)
print(msg, file=sys.stderr)
sys.stderr.flush()

# Load up the any app specific configuration
if cfg:
Expand Down

0 comments on commit 2e0dcce

Please sign in to comment.