summaryrefslogtreecommitdiffstats
path: root/library/python/cores
diff options
context:
space:
mode:
authorDaniil Cherednik <[email protected]>2022-09-21 20:17:38 +0300
committerDaniil Cherednik <[email protected]>2022-09-21 20:17:38 +0300
commite6c9b17192c56494adba359d5e132c431b241191 (patch)
tree6f2449871a118a0e8919ce842b1174e06cb470ef /library/python/cores
parent285021ab1aac39e84b269d9bacd4deee69cf63fc (diff)
Ydb stable 22-4-2122.4.21
x-stable-origin-commit: e89099581237299a132feafb5b58af59ebd0468a
Diffstat (limited to 'library/python/cores')
-rw-r--r--library/python/cores/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/python/cores/__init__.py b/library/python/cores/__init__.py
index e3eea6ab5db..e99b8f65dfd 100644
--- a/library/python/cores/__init__.py
+++ b/library/python/cores/__init__.py
@@ -4,6 +4,7 @@ import os
import re
import glob
import socket
+import sys
import logging
import platform
import subprocess
@@ -93,7 +94,10 @@ def recover_core_dump_file(binary_path, cwd, pid, core_pattern=None):
oct(stat.S_ISVTX),
)
logger.debug("Search for core dump files match pattern '%s' in '%s'", pattern.mask, pattern.path)
- cores = glob.glob(os.path.join(pattern.path, pattern.mask))
+ escaped_pattern_path = pattern.path
+ if sys.version_info[0] == 3:
+ escaped_pattern_path = glob.escape(pattern.path)
+ cores = glob.glob(os.path.join(escaped_pattern_path, pattern.mask))
files = os.listdir(pattern.path)
logger.debug(
"Matched core dump files (%d/%d): [%s] (mismatched samples: %s)",