{"id":478831,"date":"2026-05-06T17:10:39","date_gmt":"2026-05-06T17:10:39","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=478831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=478831","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0448\u044c: &#171;divizion by zero&#187; \u2014 \u0447\u0442\u043e \u044d\u0442\u043e? \u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0435\u0451 \u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0447\u0430\u0441\u0442\u043e \u043b\u0435\u0437\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0442\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u0432\u0441\u0435 \u043d\u0435\u043f\u043e\u0439\u043c\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 Python \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a Google Translator \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0432\u0441\u0435\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 Python:<\/p>\n<pre><code class=\"powershell\">pip install deep_translator<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c colorama. \u0412\u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<pre><code class=\"powershell\">pip install colorama<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430! \u042f \u0440\u0430\u0437\u0431\u0438\u043b \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<p>error_translator.py:<\/p>\n<pre><code class=\"python\">import sysimport warningsimport osimport jsonimport timeimport refrom deep_translator import GoogleTranslatorSOURCE_LANG = 'auto'TARGET_LANG = 'ru'CACHE_DIR = os.path.join(os.path.dirname(__file__), 'error_cache')CACHE_FILE = os.path.join(CACHE_DIR, 'translations.json')MAX_CACHE_ENTRIES = 100000translator = GoogleTranslator(source=SOURCE_LANG, target=TARGET_LANG)def _load_cache():    if not os.path.exists(CACHE_FILE):        return {}    try:        with open(CACHE_FILE, 'r', encoding='utf-8') as f:            return json.load(f)    except:        return {}def _save_cache(cache):    os.makedirs(CACHE_DIR, exist_ok=True)    if len(cache) &gt; MAX_CACHE_ENTRIES:        sorted_items = sorted(cache.items(), key=lambda x: x[1].get('timestamp', 0))        cache = dict(sorted_items[-MAX_CACHE_ENTRIES:])    with open(CACHE_FILE, 'w', encoding='utf-8') as f:        json.dump(cache, f, ensure_ascii=False, indent=2)def cached_translate(text):    if not text:        return text    cache = _load_cache()    if text in cache:        return cache[text]['translation']    try:        translated = translator.translate(text)    except Exception:        return text    cache[text] = {'translation': translated, 'timestamp': time.time()}    _save_cache(cache)    return translateddef translate_exc_message(msg):    cleaned = re.sub(r'0x[0-9a-fA-F]+', '...', msg)    return cached_translate(cleaned)original_excepthook = sys.excepthookdef translating_excepthook(exc_type, exc_value, exc_tb):    if exc_value is not None:        translated = translate_exc_message(str(exc_value))        try:            new_exc = exc_type(translated)        except Exception:            new_exc = exc_value    else:        new_exc = exc_value    original_excepthook(exc_type, new_exc, exc_tb)original_showwarning = warnings.showwarningdef translating_showwarning(message, category, filename, lineno, file=None, line=None):    translated = translate_exc_message(str(message))    original_showwarning(translated, category, filename, lineno, file, line)sys.excepthook = translating_excepthookwarnings.showwarning = translating_showwarning<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>run.py:<\/p>\n<pre><code class=\"python\">import sysimport subprocessimport reimport osfrom pathlib import Pathimport coloramacolorama.init()sys.path.insert(0, str(Path(__file__).parent))from error_translator import cached_translatesys.stdout.reconfigure(encoding='utf-8', errors='replace')sys.stderr.reconfigure(encoding='utf-8', errors='replace')RED = colorama.Fore.REDRESET = colorama.Style.RESET_ALLerror_header_pattern = re.compile(    r'^(Traceback \\(most recent call last\\):|Exception in|During handling of|The above exception was)')in_error_block = Falsepending_warning_source = Falsedef translate_line(line):    global in_error_block, pending_warning_source    if pending_warning_source:        pending_warning_source = False        if line.startswith('  ') or line.startswith('\\t'):            return RED + line.rstrip('\\n') + RESET + '\\n'        else:            in_error_block = False            return line    if error_header_pattern.match(line):        in_error_block = True        return RED + line.rstrip('\\n') + RESET + '\\n'    if not in_error_block and line.startswith('  File '):        in_error_block = True        return RED + line.rstrip('\\n') + RESET + '\\n'    warning_match = re.search(r'(:\\d+:)\\s*(\\w+Warning):\\s*(.*)', line)    if warning_match:        if not in_error_block:            in_error_block = True        pending_warning_source = True        prefix = line[:warning_match.start(1)]        lineno = warning_match.group(1)        category = warning_match.group(2)        msg = warning_match.group(3)        if msg:            translated_msg = cached_translate(msg)            return f\"{RED}{prefix}{lineno} {category}: {translated_msg}{RESET}\\n\"        else:            return RED + line.rstrip('\\n') + RESET + '\\n'    if in_error_block:        if line.startswith('  File ') or line.startswith('    ') or line.startswith('\\t'):            return RED + line.rstrip('\\n') + RESET + '\\n'        m = re.match(r'^(\\s*(?:\\w+\\.)*\\w*(?:Error|Warning|Exception)):\\s*(.*)', line)        if m:            exc_part, msg = m.groups()            if msg:                translated = f\"{RED}{exc_part}: {cached_translate(msg)}{RESET}\\n\"            else:                translated = RED + line.rstrip('\\n') + RESET + '\\n'            in_error_block = False            return translated        if line.strip() == '':            return RED + '\\n'        in_error_block = False        return line    return linedef run_target(target_script):    env = os.environ.copy()    env['PYTHONUNBUFFERED'] = '1'    p = subprocess.Popen(        [sys.executable, target_script],        stdout=subprocess.PIPE,        stderr=subprocess.STDOUT,        text=True,        encoding='utf-8',        errors='replace',        env=env,        bufsize=1    )    for line in p.stdout:        sys.stdout.write(translate_line(line))        sys.stdout.flush()    p.wait()    sys.exit(p.returncode)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>translate_errors.py:<\/p>\n<pre><code class=\"python\">TARGET = \"test.py\"; from run import run_target; run_target(TARGET)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a: \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f <code>translate_errors.py<\/code> \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435 <code>TARGET<\/code> \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u044b\u0432\u043e\u0434\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443, \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0451 \u0432 Google \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430. \u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0441\u0442\u0430\u0451\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/46e\/db1\/f6f\/46edb1f6f223fa57d18f9eea3edcb425.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Python \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Python \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435\" width=\"1346\" height=\"207\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/46e\/db1\/f6f\/46edb1f6f223fa57d18f9eea3edcb425.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/46e\/db1\/f6f\/46edb1f6f223fa57d18f9eea3edcb425.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Python \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u043e \u0438 \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 <code>test_warning.py<\/code> \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>translate_errors.py<\/code>:<\/p>\n<pre><code class=\"python\">import warningswarnings.warn(\"This is a test warning\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df8\/b1c\/c20\/df8b1cc201d943d2467824b14ca83013.png\" alt=\"\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435\" title=\"\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435\" width=\"1346\" height=\"212\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/df8\/b1c\/c20\/df8b1cc201d943d2467824b14ca83013.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df8\/b1c\/c20\/df8b1cc201d943d2467824b14ca83013.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430 \u0434\u0438\u0441\u043a (\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0434\u043e 100000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u043c\u043e\u0434\u0443\u043b\u044f). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a \u0438 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439)!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u2014 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f. \u041d\u0438\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043e\u043f\u0440\u043e\u0441. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0431\u0430\u0433\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445. \u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u043e\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u0434, \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0432 \u0432\u0441\u0435 \u0431\u0430\u0433\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439!<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1032158\/\">https:\/\/habr.com\/ru\/articles\/1032158\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0448\u044c: &#171;divizion by zero&#187; \u2014 \u0447\u0442\u043e \u044d\u0442\u043e? \u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0435\u0451 \u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0447\u0430\u0441\u0442\u043e \u043b\u0435\u0437\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0442\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u0432\u0441\u0435 \u043d\u0435\u043f\u043e\u0439\u043c\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 Python \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a Google Translator \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0432\u0441\u0435\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 Python:pip install deep_translator\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c colorama. \u0412\u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430:pip install colorama\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430! \u042f \u0440\u0430\u0437\u0431\u0438\u043b \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u043e\u0442 \u043a\u043e\u0434:error_translator.py:import sysimport warningsimport osimport jsonimport timeimport refrom deep_translator import GoogleTranslatorSOURCE_LANG = &#8216;auto&#8217;TARGET_LANG = &#8216;ru&#8217;CACHE_DIR = os.path.join(os.path.dirname(__file__), &#8216;error_cache&#8217;)CACHE_FILE = os.path.join(CACHE_DIR, &#8216;translations.json&#8217;)MAX_CACHE_ENTRIES = 100000translator = GoogleTranslator(source=SOURCE_LANG, target=TARGET_LANG)def _load_cache():    if not os.path.exists(CACHE_FILE):        return {}    try:        with open(CACHE_FILE, &#8216;r&#8217;, encoding=&#8217;utf-8&#8242;) as f:            return json.load(f)    except:        return {}def _save_cache(cache):    os.makedirs(CACHE_DIR, exist_ok=True)    if len(cache) &gt; MAX_CACHE_ENTRIES:        sorted_items = sorted(cache.items(), key=lambda x: x[1].get(&#8216;timestamp&#8217;, 0))        cache = dict(sorted_items[-MAX_CACHE_ENTRIES:])    with open(CACHE_FILE, &#8216;w&#8217;, encoding=&#8217;utf-8&#8242;) as f:        json.dump(cache, f, ensure_ascii=False, indent=2)def cached_translate(text):    if not text:        return text    cache = _load_cache()    if text in cache:        return cache[text][&#8216;translation&#8217;]    try:        translated = translator.translate(text)    except Exception:        return text    cache[text] = {&#8216;translation&#8217;: translated, &#8216;timestamp&#8217;: time.time()}    _save_cache(cache)    return translateddef translate_exc_message(msg):    cleaned = re.sub(r&#8217;0x[0-9a-fA-F]+&#8217;, &#8216;&#8230;&#8217;, msg)    return cached_translate(cleaned)original_excepthook = sys.excepthookdef translating_excepthook(exc_type, exc_value, exc_tb):    if exc_value is not None:        translated = translate_exc_message(str(exc_value))        try:            new_exc = exc_type(translated)        except Exception:            new_exc = exc_value    else:        new_exc = exc_value    original_excepthook(exc_type, new_exc, exc_tb)original_showwarning = warnings.showwarningdef translating_showwarning(message, category, filename, lineno, file=None, line=None):    translated = translate_exc_message(str(message))    original_showwarning(translated, category, filename, lineno, file, line)sys.excepthook = translating_excepthookwarnings.showwarning = translating_showwarningrun.py:import sysimport subprocessimport reimport osfrom pathlib import Pathimport coloramacolorama.init()sys.path.insert(0, str(Path(__file__).parent))from error_translator import cached_translatesys.stdout.reconfigure(encoding=&#8217;utf-8&#8242;, errors=&#8217;replace&#8217;)sys.stderr.reconfigure(encoding=&#8217;utf-8&#8242;, errors=&#8217;replace&#8217;)RED = colorama.Fore.REDRESET = colorama.Style.RESET_ALLerror_header_pattern = re.compile(    r&#8217;^(Traceback \\(most recent call last\\):|Exception in|During handling of|The above exception was)&#8217;)in_error_block = Falsepending_warning_source = Falsedef translate_line(line):    global in_error_block, pending_warning_source    if pending_warning_source:        pending_warning_source = False        if line.startswith(&#8216;  &#8216;) or line.startswith(&#8216;\\t&#8217;):            return RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;        else:            in_error_block = False            return line    if error_header_pattern.match(line):        in_error_block = True        return RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;    if not in_error_block and line.startswith(&#8216;  File &#8216;):        in_error_block = True        return RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;    warning_match = re.search(r'(:\\d+:)\\s*(\\w+Warning):\\s*(.*)&#8217;, line)    if warning_match:        if not in_error_block:            in_error_block = True        pending_warning_source = True        prefix = line[:warning_match.start(1)]        lineno = warning_match.group(1)        category = warning_match.group(2)        msg = warning_match.group(3)        if msg:            translated_msg = cached_translate(msg)            return f&#187;{RED}{prefix}{lineno} {category}: {translated_msg}{RESET}\\n&#187;        else:            return RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;    if in_error_block:        if line.startswith(&#8216;  File &#8216;) or line.startswith(&#8216;    &#8216;) or line.startswith(&#8216;\\t&#8217;):            return RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;        m = re.match(r&#8217;^(\\s*(?:\\w+\\.)*\\w*(?:Error|Warning|Exception)):\\s*(.*)&#8217;, line)        if m:            exc_part, msg = m.groups()            if msg:                translated = f&#187;{RED}{exc_part}: {cached_translate(msg)}{RESET}\\n&#187;            else:                translated = RED + line.rstrip(&#8216;\\n&#8217;) + RESET + &#8216;\\n&#8217;            in_error_block = False            return translated        if line.strip() == &#187;:            return RED + &#8216;\\n&#8217;        in_error_block = False        return line    return linedef run_target(target_script):    env = os.environ.copy()    env[&#8216;PYTHONUNBUFFERED&#8217;] = &#8216;1&#8217;    p = subprocess.Popen(        [sys.executable, target_script],        stdout=subprocess.PIPE,        stderr=subprocess.STDOUT,        text=True,        encoding=&#8217;utf-8&#8242;,        errors=&#8217;replace&#8217;,        env=env,        bufsize=1    )    for line in p.stdout:        sys.stdout.write(translate_line(line))        sys.stdout.flush()    p.wait()    sys.exit(p.returncode)translate_errors.py:TARGET = &#171;test.py&#187;; from run import run_target; run_target(TARGET)\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a: \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f translate_errors.py \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435 TARGET \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u044b\u0432\u043e\u0434\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443, \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0451 \u0432 Google \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430. \u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0441\u0442\u0430\u0451\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Python \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u043e \u0438 \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 test_warning.py \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c translate_errors.py:import warningswarnings.warn(&#171;This is a test warning&#187;)\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430 \u0434\u0438\u0441\u043a (\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0434\u043e 100000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u043c\u043e\u0434\u0443\u043b\u044f). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a \u0438 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439)!\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u2014 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f. \u041d\u0438\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043e\u043f\u0440\u043e\u0441. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0431\u0430\u0433\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445. \u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u043e\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u0434, \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0432 \u0432\u0441\u0435 \u0431\u0430\u0433\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439!\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1032158\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-478831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/478831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=478831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/478831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=478831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=478831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=478831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}