diff options
| author | bwarsaw | 2002-10-18 22:00:42 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-10-18 22:00:42 +0000 |
| commit | 0f0019b86ba343af89b955d06a5ccf5f75b85f0d (patch) | |
| tree | 26821a830f78f56289dc667e1a97cb058216920c | |
| parent | cd009003bbfb4eb89fdb9682865c3c5595cc976a (diff) | |
| download | mailman-0f0019b86ba343af89b955d06a5ccf5f75b85f0d.tar.gz mailman-0f0019b86ba343af89b955d06a5ccf5f75b85f0d.tar.zst mailman-0f0019b86ba343af89b955d06a5ccf5f75b85f0d.zip | |
| -rw-r--r-- | Mailman/Archiver/HyperArch.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py index c4078c912..29a57f5c5 100644 --- a/Mailman/Archiver/HyperArch.py +++ b/Mailman/Archiver/HyperArch.py @@ -55,6 +55,25 @@ if mm_cfg.GZIP_ARCHIVE_TXT_FILES: EMPTYSTRING = '' NL = '\n' +# MacOSX has a default stack size that is too small for deeply recursive +# regular expressions. We see this as crashes in the Python test suite when +# running test_re.py and test_sre.py. The fix is to set the stack limit to +# 2048; the general recommendation is to do in the shell before running the +# test suite. But that's inconvenient for a daemon like the qrunner. +# +# AFAIK, this problem only affects the archiver, so we're adding this work +# around to this file (it'll get imported by the bundled pipermail or by the +# bin/arch script. We also only do this on darwin, a.k.a. MacOSX. +if sys.platform == 'darwin': + try: + import resource + except ImportError: + pass + else: + soft, hard = resource.getrlimit(resource.RLIMIT_STACK) + newsoft = min(hard, max(soft, 1024*2048)) + resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard)) + def unicode_quote(arg): |
