@@ -2394,8 +2394,9 @@ def check_percentage(option, opt_str, value, parser):
2394
2394
optparse .make_option ('--server-root' , metavar = 'DIRECTORY-PATH' ,
2395
2395
help = 'Specify an alternate directory for where the generated '
2396
2396
'web server configuration, startup files and logs will be '
2397
- 'stored. Defaults to the sub directory specified by the '
2398
- 'TMPDIR environment variable, or /tmp if not specified.' ),
2397
+ 'stored. On Linux defaults to the sub directory specified by '
2398
+ 'the TMPDIR environment variable, or /tmp if not specified. '
2399
+ 'On macOS, defaults to the /var/tmp directory.' ),
2399
2400
2400
2401
optparse .make_option ('--server-mpm' , action = 'append' ,
2401
2402
dest = 'server_mpm_variables' , metavar = 'NAME' , help = 'Specify '
@@ -2664,9 +2665,12 @@ def _cmd_setup_server(command, args, options):
2664
2665
options ['port' ], os .getuid ())
2665
2666
2666
2667
if not options ['server_root' ]:
2667
- tmpdir = os .environ .get ('TMPDIR' )
2668
- tmpdir = tmpdir or '/tmp'
2669
- tmpdir = tmpdir .rstrip ('/' )
2668
+ if sys .platform == 'darwin' :
2669
+ tmpdir = '/var/tmp'
2670
+ else :
2671
+ tmpdir = os .environ .get ('TMPDIR' )
2672
+ tmpdir = tmpdir or '/tmp'
2673
+ tmpdir = tmpdir .rstrip ('/' )
2670
2674
options ['server_root' ] = '%s/mod_wsgi-%s:%s:%s' % (tmpdir ,
2671
2675
options ['host' ], options ['port' ], os .getuid ())
2672
2676
0 commit comments