{"id":456499,"date":"2025-04-18T15:00:19","date_gmt":"2025-04-18T15:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=456499"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=456499","title":{"rendered":"<span>\u0421\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c CPython \u0432\u043e\u043a\u0440\u0443\u0433 PVS-Studio<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Python&#8230; \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0417\u0430 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 &#171;\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&#187; \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0432\u0430\u043d\u0438\u0435 &#171;\u043b\u0443\u0447\u0448\u0435\u0433\u043e Excel&#187;. \u0417\u0430 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 C \u0438 C++ \u043a\u043e\u0434 \u0435\u0433\u043e \u043b\u044e\u0431\u0438\u0442 \u0433\u0435\u0439\u043c\u0434\u0435\u0432. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443 \u043d\u0435\u0433\u043e \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f!<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/02c\/010\/6d0\/02c0106d007713be126a1555497dcbf7.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/02c\/010\/6d0\/02c0106d007713be126a1555497dcbf7.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/02c\/010\/6d0\/02c0106d007713be126a1555497dcbf7.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438 \u0441\u0430\u043c\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0443\u044e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python \u2014 CPython. \u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 C. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u0447\u0442\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0414\/\">\u0434\u0435\u0432\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434<\/a>, \u0438 \u0431\u0435\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0418\/\">\u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0439<\/a> \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c. \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u044f\u0437\u044b\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0448\u0430\u0433\u043d\u0443\u043b \u0432\u043f\u0435\u0440\u0451\u0434 \u0432 \u0441\u0435\u0440\u0438\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 Python 3, \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043c\u0438\u0440 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c. API <a href=\"https:\/\/docs.python.org\/3\/c-api\/index.html\">Python\/C<\/a> \u0442\u043e\u0436\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u043b\u0441\u044f, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0448\u043b\u0438 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0434\u0438\u0438 <code>DeprecationWarning<\/code>. \u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b&#8230;<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PVS-Studio<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PVS-Studio. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u0441 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/download\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1246\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f \u2014 \u0435\u0451 \u0442\u0440\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1246\">\u043f\u043e \u0449\u0435\u043b\u0447\u043a\u0443 \u043c\u044b\u0448\u0438<\/a> \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0430\u043a\u043a\u043e\u0440\u0434\u0443 \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438 \u043f\u043e \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u043b\u0435\u0433\u043a\u043e: \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f Visual Studio 2022. \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f PVS-Studio \u2014 7.35.<\/p>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/h3>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043d\u0430 \u043d\u0430\u0448 \u0441\u0442\u043e\u043b \u043f\u043e\u043f\u0430\u043b \u0433\u043e\u0442\u043e\u0432\u044f\u0449\u0438\u0439\u0441\u044f \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 \u0440\u0435\u043b\u0438\u0437 CPython 3.13.3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0437\u044f\u043b\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/python\/cpython\/tree\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\">e6dfa9d<\/a>. \u041e\u0431\u044b\u0447\u043d\u043e \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0432 &#171;\u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439&#187; (Debug) \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u0435\u043d\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u043e \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 &#171;\u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439&#187; (Release), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 CPython 3 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 Windows: \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>PCbuild<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0438\u0437 \u043d\u0435\u0451 \u0444\u0430\u0439\u043b <code>get_externals.bat<\/code>. \u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430.<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/h3>\n<p>\u0412 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435 <code>PCbuild<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u044f <code>pcbuild.sln<\/code>, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 CPython. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f batch-\u0444\u0430\u0439\u043b <code>get_externals.bat<\/code>, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u0430 \u043f\u0430\u043f\u043e\u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">D:\\Git\\cpython\\PCbuild&gt;get_externals.bat Using py -3.12 (found 3.12 with py.exe) Fetching external libraries... Fetching bzip2-1.0.8... Fetching mpdecimal-4.0.0... Fetching sqlite-3.45.3.0... Fetching xz-5.2.5... Fetching zlib-1.3.1... Fetching external binaries... Fetching libffi-3.4.4... Fetching openssl-bin-3.0.15... Fetching tcltk-8.6.15.0... Finished. <\/code><\/pre>\n<p>\u041d\u0435 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 <code>externals<\/code>, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0443\u044e\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u044b\u0448\u0435. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0451 \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 Visual Studio, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a: <strong>Extensions &gt; PVS-Studio &gt; Options &gt; Don&#8217;t Check Files<\/strong>. \u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0435 \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0430\u043f\u043a\u0438 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/6640\/\">\u0432 \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">D:\\Git\\cpython\\externals\\ <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0436, \u043b\u0435\u0437\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u044c&#8230;<\/p>\n<h4>MD5 \u0432\u0441\u0435\u043b\u044f\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c&#8230;<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;p&#8217;. Check lines: 1174, 1173. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1174\">Hacl_Hash_MD5.c 1174<\/a><\/p>\n<pre><code class=\"cpp\">#ifndef KRML_HOST_MALLOC #  define KRML_HOST_MALLOC malloc #endif  Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_malloc(void) {   ....   Hacl_Streaming_MD_state_32   *p = (Hacl_Streaming_MD_state_32 *)         KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));   p[0U] = s;                                                   \/\/ &lt;=   .... } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 1415, 1414. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1415\">Hacl_Hash_MD5.c 1415<\/a><\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 1417, 1416. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1417\">Hacl_Hash_MD5.c 1417<\/a><\/p>\n<pre><code class=\"cpp\">#ifndef KRML_HOST_CALLOC #  define KRML_HOST_CALLOC calloc #endif  Hacl_Streaming_MD_state_32 * Hacl_Hash_MD5_copy(Hacl_Streaming_MD_state_32 *state) {   Hacl_Streaming_MD_state_32 scrut = *state;   uint32_t *block_state0 = scrut.block_state;   uint8_t *buf0 = scrut.buf;   ....   uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC(64U, sizeof (uint8_t));   memcpy(buf, buf0, 64U * sizeof (uint8_t));                         \/\/ &lt;=   uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC(4U, sizeof (uint32_t));   memcpy(block_state, block_state0, 4U * sizeof (uint32_t));         \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u043e\u0448\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0443\u0447\u043d\u043e. \u041d\u0435\u0442, \u044d\u0442\u0438 \u0442\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 MD5 \u043f\u0440\u0438\u0437\u043d\u0430\u043b\u0438 \u043d\u0435\u043a\u0440\u0438\u043f\u0442\u043e\u0441\u0442\u043e\u0439\u043a\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u0435\u043b\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <code>calloc<\/code>\/<code>malloc<\/code> <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442<\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>memcpy<\/code> \u0441 \u0432\u0438\u0434\u0443 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0430\u044f \u0431\u0443\u043a\u0430\u0448\u043a\u0430. \u041d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0430\u044f, \u0447\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 MSVC \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/c-runtime-library\/reference\/memcpy-wmemcpy\">\u043f\u043e\u0431\u044c\u0451\u0442 SDL-\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438<\/a> \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 <code>memcpy<\/code> \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043f\u0435\u0442\u044c \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u0440\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 <code>NULL<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u0430 \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430, \u0438 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h4>&#8230;\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2014 \u043d\u0435\u0442?<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;fut-&gt;fut_state != STATE_PENDING&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_asynciomodule.c#L506\">_asynciomodule.c 506<\/a><\/p>\n<pre><code class=\"cpp\">static PyObject * future_set_exception(asyncio_state *state, FutureObj *fut, PyObject *exc) {   PyObject *exc_val = NULL;    if (fut-&gt;fut_state != STATE_PENDING) {           \/\/ &lt;=       PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");       return NULL;   }    if (PyExceptionClass_Check(exc)) {       exc_val = PyObject_CallNoArgs(exc);       if (exc_val == NULL) {         return NULL;       }       if (fut-&gt;fut_state != STATE_PENDING) {      \/\/ &lt;=           Py_DECREF(exc_val);           PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");           return NULL;       }   }   .... } <\/code><\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v547\/\">\u0447\u0430\u0441\u0442\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439<\/a>. \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <code>fut-&gt;fut_state<\/code>:<\/p>\n<pre><code class=\"cpp\">if (fut-&gt;fut_state != STATE_PENDING) {           \/\/ &lt;=     PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");     xreturn NULL; } <\/code><\/pre>\n<p>\u041c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u0434\u043e \u043b\u0438 \u043d\u0430\u043c \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435&#8230; \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>fut-&gt;fut_state<\/code>? \u041d\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u0442\u0430\u043c <code>STATE_PENDING<\/code>! \u0412 \u0438\u0442\u043e\u0433\u0435 \u043b\u0438\u0448\u043d\u044f\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0441\u0435\u0442\u044c. \u0423\u043f\u043b\u043e\u0449\u0430\u0435\u043c \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (PyExceptionClass_Check(exc)) {     exc_val = PyObject_CallNoArgs(exc);     if (exc_val == NULL) {       return NULL;     }     Py_DECREF(exc_val);     PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");     return NULL; } <\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0441\u0445\u043e\u0436\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1156\">1156<\/a><\/p>\n<\/li>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1190\">1190<\/a><\/p>\n<\/li>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1450\">1450<\/a><\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;error_handler == _Py_ERROR_UNKNOWN&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Objects\/unicodeobject.c#L15765\">unicodeobject.c 15765<\/a><\/p>\n<p>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">static _Py_error_handler get_error_handler_wide(const wchar_t *errors) {     if (errors == NULL || wcscmp(errors, L\"strict\") == 0) {         return _Py_ERROR_STRICT;     }     if (wcscmp(errors, L\"surrogateescape\") == 0) {         return _Py_ERROR_SURROGATEESCAPE;     }     if (wcscmp(errors, L\"replace\") == 0) {         return _Py_ERROR_REPLACE;     }     if (wcscmp(errors, L\"ignore\") == 0) {         return _Py_ERROR_IGNORE;     }     if (wcscmp(errors, L\"backslashreplace\") == 0) {         return _Py_ERROR_BACKSLASHREPLACE;     }     if (wcscmp(errors, L\"surrogatepass\") == 0) {         return _Py_ERROR_SURROGATEPASS;     }     if (wcscmp(errors, L\"xmlcharrefreplace\") == 0) {         return _Py_ERROR_XMLCHARREFREPLACE;     }     return _Py_ERROR_OTHER; }  static int init_fs_codec(PyInterpreterState *interp) {     const PyConfig *config = _PyInterpreterState_GetConfig(interp);      _Py_error_handler error_handler;     error_handler = get_error_handler_wide(config-&gt;filesystem_errors);     if (error_handler == _Py_ERROR_UNKNOWN) {                              \/\/ &lt;=         PyErr_SetString(PyExc_RuntimeError, \"unknown filesystem error handler\");         return -1;     }     .... } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u0437\u0430\u043f\u0430\u0445 \u043f\u043e\u0434\u0433\u043e\u0440\u0435\u0432\u0448\u0435\u0439 \u0447\u0435\u0448\u0443\u0438, \u0432\u044b \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438 \ud83d\ude42 \u0415\u0441\u043b\u0438 \u043d\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435, \u043d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0451 \u043f\u043e\u043a\u0430\u0436\u0435\u043c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>get_error_handler_wide<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 <code>_Py_ERROR_UNKNOWN<\/code>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0438\u0434\u0451\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430. \u0418\u0437 \u043d\u0435\u0451 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0439\u0442\u0438 \u0441 \u044d\u0442\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c: \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 <strong>\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f<\/strong> \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 <code>return<\/code> \u0441 \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u0420\u0430\u0437 \u0443 \u043d\u0430\u0441 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0441\u044e\u0436\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u043e\u0432\u043e\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435? \u0425\u043c-\u043c-\u043c&#8230;<\/p>\n<pre><code class=\"cpp\">typedef enum {     _Py_ERROR_UNKNOWN=0,          \/\/ &lt;=     _Py_ERROR_STRICT,     _Py_ERROR_SURROGATEESCAPE,     _Py_ERROR_REPLACE,     _Py_ERROR_IGNORE,     _Py_ERROR_BACKSLASHREPLACE,     _Py_ERROR_SURROGATEPASS,     _Py_ERROR_XMLCHARREFREPLACE,     _Py_ERROR_OTHER } _Py_error_handler; <\/code><\/pre>\n<p>\u041e\u0439, \u0430 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 <s>\u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f<\/s> \u043d\u0435\u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430. \u041c\u043e\u0436\u043d\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e &#171;\u043f\u0440\u043e\u0447\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438&#187; \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c &#171;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430&#187;, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c &#171;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443&#187;, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c &#171;\u043f\u0440\u043e\u0447\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430&#187;? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u0434\u0443\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043e\u043d\u0438 \u0432\u0441\u0435 \u043c\u0438\u043c\u043e.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b6e\/7e5\/7ae\/b6e7e57aef0acb5336734c8c78c415e3.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/b6e\/7e5\/7ae\/b6e7e57aef0acb5336734c8c78c415e3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b6e\/7e5\/7ae\/b6e7e57aef0acb5336734c8c78c415e3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u041e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439<\/h4>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;capi == NULL&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_datetimemodule.c#L7236\">_datetimemodule.c 7236<\/a><\/p>\n<pre><code class=\"cpp\">\/* The C-API is process-global.  This violates interpreter isolation  * due to the objects stored here.  Thus each of those objects must  * be managed carefully. *\/ \/\/ XXX Can we make this const? static PyDateTime_CAPI capi = {     .... }  \/* Get a new C API by calling this function.  * Clients get at C API via PyDateTime_IMPORT, defined in datetime.h.  *\/ static inline PyDateTime_CAPI * get_datetime_capi(void) {     return &amp;capi; }  static int _datetime_exec(PyObject *module) {     ....     \/* At last, set up and add the encapsulated C API *\/     PyDateTime_CAPI *capi = get_datetime_capi();     if (capi == NULL) {                            \/\/ &lt;=         goto error;     }     .... } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 <code>get_datetime_capi<\/code>. \u0421\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u0434\u0443, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 <code>PyDateTime<\/code>, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0435\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e: \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 <em>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u0447\u0438\u043d \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0422\u043e\u0447\u043d\u0435\u0435, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0431\u044b\u0442\u044c, \u043d\u043e \u0430\u0434\u0440\u0435\u0441 \u0443 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f Python\/C \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0438\u0445 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u0442\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u0447\u0435\u043c\u0443. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0435 \u0432\u0435\u0440\u0438\u0442\u0435, \u0442\u043e \u0432 \u0445\u043e\u0434 \u043f\u043e\u0439\u0434\u0451\u0442 \u0442\u044f\u0436\u0451\u043b\u0430\u044f \u0430\u0440\u0442\u0438\u043b\u043b\u0435\u0440\u0438\u044f \u2014 <em>WinDbg<\/em>. \u041e\u0442\u043b\u0430\u0434\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430 Windows!<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c3f\/9d3\/4c6\/c3f9d34c6d13a1d57c2704b8ae1c3c42.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/c3f\/9d3\/4c6\/c3f9d34c6d13a1d57c2704b8ae1c3c42.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c3f\/9d3\/4c6\/c3f9d34c6d13a1d57c2704b8ae1c3c42.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0447\u0435\u0441\u0442\u043d\u043e, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b Python \u0438\u0437-\u043f\u043e\u0434 \u043d\u0435\u0433\u043e. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0435\u0449\u0451 \u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <code>capi<\/code> \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u043b\u0430 \u043c\u0435\u0441\u0442\u043e \u0432 \u043f\u0435\u0440\u0435\u0434\u043d\u0435\u043c \u0440\u044f\u0434\u0443. \u0412\u044b\u0432\u043e\u0434: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u0434\u0430, \u043e\u043d\u0430 \u043d\u0438 \u043d\u0430 \u0447\u0442\u043e \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0435\u0441\u043b\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <code>get_datetime_capi<\/code> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0445\u0438\u0442\u0440\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<h4>SDK \u0431\u044c\u0451\u0442 \u043f\u043e \u0440\u0443\u043a\u0430\u043c<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;t != u&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_datetimemodule.c#L5245\">_datetimemodule.c 5245<\/a><\/p>\n<pre><code class=\"cpp\">static long long local(long long u) {     struct tm local_time;     time_t t;     u -= epoch;     t = u;     if (t != u) {         PyErr_SetString(PyExc_OverflowError,         \"timestamp out of range for platform time_t\");         return -1;     }     .... } <\/code><\/pre>\n<p>\u041e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0432 38-\u043c\u0438\u043d\u0443\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0440 \u043d\u0430 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u043d\u0430\u0445, \u0438 \u044d\u0442\u043e \u043d\u0435 \u0448\u0443\u0442\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0433\u0440\u0435\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430. \u0412 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430?<\/p>\n<p>\u0427\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044f \u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e:<\/p>\n<pre><code class=\"cpp\">t = u; if (t != u) { .... } <\/code><\/pre>\n<p>\u0418 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043c\u044b\u0441\u043b\u0438\u0442\u044c \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u043c\u043e\u043b, \u0447\u0442\u043e \u0437\u0430 \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0435, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0441\u0430\u043c\u0438\u043c \u0441\u043e\u0431\u043e\u0439, \u0432\u0435\u0434\u044c <code>time_t<\/code> \u0443\u0436\u0435 <code>long long<\/code>! \u0410 \u0432\u043e\u0442 \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0422\u0438\u043f <code>time_t<\/code> <a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/c-runtime-library\/time-management\">\u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f 64-\u0431\u0438\u0442\u043d\u044b\u043c<\/a>, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Visual Studio 2005. \u041d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 32-\u0431\u0438\u0442\u043d\u044b\u0439 <code>time_t<\/code> \u043d\u0430 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u043e \u0447\u0451\u043c \u043d\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>corecrt.h<\/code> \u0438\u0437 <em>Universal C Runtime<\/em>. Visual Studio \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <em>UCRT<\/em> \u0441 Visual Studio 2015.<\/p>\n<pre><code class=\"cpp\">#if defined _USE_32BIT_TIME_T &amp;&amp; defined _WIN64     #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64 #endif  #ifndef _CRT_NO_TIME_T     #ifdef _USE_32BIT_TIME_T         typedef __time32_t time_t;     #else         typedef __time64_t time_t;     #endif #endif <\/code><\/pre>\n<p>Visual Studio 2005 \u0442\u043e\u0436\u0435 \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442, \u043e \u0447\u0451\u043c \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <code>crtdefs.h<\/code> \u0438\u0437 Microsoft Visual C Runtime (MSVCRT).<\/p>\n<pre><code class=\"cpp\">#ifdef  _USE_32BIT_TIME_T #ifdef  _WIN64 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64 #undef  _USE_32BIT_TIME_T #endif #else #if     _INTEGRAL_MAX_BITS &lt; 64 #define _USE_32BIT_TIME_T #endif #endif <\/code><\/pre>\n<p>\u041d\u043e \u043e\u0434\u043d\u043e \u0434\u0435\u043b\u043e MSVC, \u0430 \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c MinGW? \u0422\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0442\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0438\u0437 MSVC, <a href=\"https:\/\/sourceforge.net\/p\/mingw-w64\/mingw-w64\/ci\/0e0eed62328177b31a54023d9e3dad7bc12c0fd0\/tree\/mingw-w64-headers\/crt\/corecrt.h#l128\">\u043f\u0440\u043e\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f<\/a>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 <code>time_t<\/code> \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u0432 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v795\/\">\u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f<\/a>.<\/p>\n<h4>\u0414\u0435\u0437\u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435<\/h4>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0445\u0432\u0430\u0442\u0438\u0442 \u0436\u0435\u0441\u0442\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u043e\u0445\u043d\u0451\u043c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043f\u0440\u043e\u0449\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0440\u0430\u0437\u0443 \u0442\u0440\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v523\/\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Python\/crossinterp.c#L1416\">crossinterp.c 1416<\/a><\/p>\n<pre><code class=\"cpp\">void _PyXI_FreeNamespace(_PyXI_namespace *ns) {     ....     if (interpid == PyInterpreterState_GetID(PyInterpreterState_Get())) {         _sharedns_free(ns);     }     else {         \/\/ If we weren't always dynamically allocating the cross-interpreter         \/\/ data in each item then we would need to using a pending call         \/\/ to call _sharedns_free(), to avoid the race between freeing         \/\/ the shared namespace and releasing the XI data.         _sharedns_free(ns);     } } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v524\/\">V524<\/a> It is odd that the body of &#8216;FStar_UInt128_u32_combine_&#8217; function is fully equivalent to the body of &#8216;FStar_UInt128_u32_combine&#8217; function. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/include\/krml\/FStar_UInt128_Verified.h#L309\">FStar_UInt128_Verified.h 309<\/a><\/p>\n<pre><code class=\"cpp\">static inline uint64_t FStar_UInt128_u32_combine(uint64_t hi, uint64_t lo)  \/\/ &lt;= {   return lo + (hi &lt;&lt; FStar_UInt128_u32_32); }  static inline uint64_t FStar_UInt128_u32_combine_(uint64_t hi, uint64_t lo) \/\/ &lt;= {   return lo + (hi &lt;&lt; FStar_UInt128_u32_32); } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1048\/\">V1048<\/a> The &#8216;val&#8217; variable was assigned the same value. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_sqlite\/blob.c#L491\">blob.c 491<\/a><\/p>\n<pre><code class=\"cpp\">static int ass_subscript_index(pysqlite_Blob *self, PyObject *item, PyObject *value) {     ....     long val = PyLong_AsLong(value);     if (val == -1 &amp;&amp; PyErr_Occurred()) {         PyErr_Clear();         val = -1;                          \/\/ &lt;=     }     .... } <\/code><\/pre>\n<p>\u0423 \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u043e\u0440\u0432\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0440\u0443\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u0431\u0438\u0442\u0438\u0435 \u0441 \u043c\u044b\u0441\u043b\u0438.<\/p>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445, \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0434\u0430\u0436\u0435 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1126\/\">LLVM<\/a>, \u0433\u0434\u0435 \u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0435\u043f\u0435\u0442\u043d\u043e. \u041d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0438 \u0437\u0430\u0431\u044b\u043b\u0438.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: \u0441\u0431\u0438\u0442\u0438\u0435 \u043a\u043e\u0433\u043e \u0441 \u043c\u044b\u0441\u043b\u0438, \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430. \u0414\u0430, \u044d\u0442\u043e <code>inline<\/code>, \u0434\u0430, \u0432 \u0442\u0435\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0451 \u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442 \u043f\u043e\u0434\u0432\u043e\u0445\u0430. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d <em>\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d<\/em> \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u041e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 <code>static<\/code>, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>inline<\/code>, \u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0434\u0432\u0443\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c.<\/p>\n<p>\u0422\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0430 \u043f\u043e\u0447\u0432\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u0432 <a href=\"https:\/\/docs.python.org\/3\/c-api\/long.html#c.PyLong_AsLong\">\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>PyLong_AsLong<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>-1<\/code>, \u0435\u0441\u043b\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 <code>PyObject*<\/code> \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u0430 <code>long<\/code> \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. \u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e ABI, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e.<\/p>\n<h4>\u041f\u043e \u0441\u0442\u043e\u043f\u0430\u043c \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a<\/h4>\n<p>&#171;\u0414\u0435\u0436\u0430\u0432\u044e?&#187; \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u044f \u0441\u0435\u0431\u044f, \u0447\u0438\u0442\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v781\/\">V781<\/a> The value of the &#8216;i&#8217; index is checked after it was used. Perhaps there is a mistake in program logic. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Parser\/lexer\/lexer.c#L143\">lexer.c 143<\/a><\/p>\n<pre><code class=\"cpp\">static int set_fstring_expr(struct tok_state* tok, struct token *token, char c) {   tokenizer_mode *tok_mode = TOK_GET_MODE(tok);   ....   if (hash_detected) {     Py_ssize_t input_length =       tok_mode-&gt;last_expr_size - tok_mode-&gt;last_expr_end;      ....      for (i = 0, j = 0; i &lt; input_length; i++) {       if (tok_mode-&gt;last_expr_buffer[i] == '#') {         \/\/ Skip characters until newline or end of string         while (   tok_mode-&gt;last_expr_buffer[i] != '\\0'                &amp;&amp; i &lt; input_length) {                           \/\/ &lt;=           ....         } .... } <\/code><\/pre>\n<p>\u041d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c. \u0422\u0430\u043a\u043e\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1187\/#ID03823B42D3\">x64dbg<\/a>. \u0414\u043e\u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 <code>input_length<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 <code>i<\/code>, \u0438 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043b\u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u043e.<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1109\/\">V1109<\/a> The &#8216;PathRemoveFileSpecW&#8217; function is deprecated. Consider switching to an equivalent newer function. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/PC\/pyshellext.cpp#L464\">pyshellext.cpp 464<\/a><\/p>\n<pre><code class=\"cpp\">class DECLSPEC_UUID(CLASS_GUID) PyShellExt : public RuntimeClass&lt;   RuntimeClassFlags&lt;ClassicCom&gt;,   IDropTarget,   IPersistFile &gt; { public:   STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode) {     ....     if (!PathRemoveFileSpecW(target_dir)) {                     \/\/ &lt;=         OutputDebugStringW(           L\"PyShellExt::Load - failed to remove filespec from target\"         );         return E_FAIL;     }     ....   } } <\/code><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V1109 \u0432 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u0435 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u043e, \u043d\u043e \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1146\/#ID688FFC349C\">\u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/a>. \u0414\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u043d\u0438\u043a\u0430 Windows \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435: \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e Python 3.13 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 Windows 7 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/07d\/e99\/066\/07de990666d583bb725d202a2f36ab80.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/07d\/e99\/066\/07de990666d583bb725d202a2f36ab80.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/07d\/e99\/066\/07de990666d583bb725d202a2f36ab80.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Microsoft \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/desktop\/api\/pathcch\/nf-pathcch-pathcchremovefilespec\"><code>PathCchRemoveFileSpec<\/code><\/a>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 Windows 8. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <a href=\"https:\/\/learn.microsoft.com\/en-us\/openspecs\/windows_protocols\/ms-dfsc\/149a3039-98ce-491a-9268-2f5ddef08192\">UNC-\u043f\u0443\u0442\u044f\u043c\u0438<\/a>, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043f\u0430\u043f\u043a\u0430\u043c\u0438. \u0421 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d \u0440\u0438\u0441\u043a \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044e \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 CPython \u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Windows API \u0440\u0430\u0441\u0442\u044f\u043d\u0443\u043b\u0430\u0441\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d27\/e02\/427\/d27e02427f717fd888e321232660ea8d.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/d27\/e02\/427\/d27e02427f717fd888e321232660ea8d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d27\/e02\/427\/d27e02427f717fd888e321232660ea8d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443, \u043f\u0438\u0448\u0443\u0449\u0435\u043c\u0443 \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 Python 2.6\/2.7 \ud83d\ude42<\/p>\n<p>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u0432 Python 3 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u043c\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u0430\u043c\u0438. \u041e\u0434\u043d\u0438\u0445 \u0432\u043e\u0437\u043c\u0443\u0449\u0430\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0445\u0430\u0440\u0430, \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0434\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c CPython \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0432\u0430\u0436\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0438\u043d\u0430\u0447\u0435 \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0435 &#171;\u0431\u0430\u0442\u0430\u0440\u0435\u0439\u043a\u0438&#187; \u0440\u0438\u0441\u043a\u0443\u044e\u0442 &#171;\u043f\u0440\u043e\u0442\u0435\u0447\u044c&#187;.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0438\u0437\u043d\u0443\u0442\u0440\u0438, \u0438 \u0441 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u043c\u0443 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e, \u0432 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, <a href=\"https:\/\/github.com\/python\/cpython\/pull\/129844#discussion_r1987010029\">\u0445\u043e\u0442\u044f \u0431\u044b Clang-Tidy<\/a>, \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442, \u0447\u0442\u043e &#171;\u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u043c&#187;. PVS-Studio \u043d\u0435 \u043b\u0438\u043d\u0442\u0435\u0440, \u043d\u043e \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0055\/\">\u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0441\u043b\u0438\u044f\u043d\u0438\u0435<\/a>. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/order\/open-source-license\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u043d\u0430 \u0433\u043e\u0434<\/a> \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<p>\u041f\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u044e\u0442, \u0447\u0442\u043e Python \u2014 \u044d\u0442\u043e \u043f\u0440\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u043e\u043c \u043f\u043e\u0436\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e Python Software Foundation \u0438 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Taras Shevchenko. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1246\/\">Curling CPython around PVS-Studio<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/902048\/\"> https:\/\/habr.com\/ru\/articles\/902048\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Python&#8230; \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0417\u0430 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 &#171;\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&#187; \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0432\u0430\u043d\u0438\u0435 &#171;\u043b\u0443\u0447\u0448\u0435\u0433\u043e Excel&#187;. \u0417\u0430 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 C \u0438 C++ \u043a\u043e\u0434 \u0435\u0433\u043e \u043b\u044e\u0431\u0438\u0442 \u0433\u0435\u0439\u043c\u0434\u0435\u0432. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443 \u043d\u0435\u0433\u043e \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f!<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438 \u0441\u0430\u043c\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0443\u044e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python \u2014 CPython. \u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 C. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u0447\u0442\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0414\/\">\u0434\u0435\u0432\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434<\/a>, \u0438 \u0431\u0435\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0418\/\">\u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0439<\/a> \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c. \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u044f\u0437\u044b\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0448\u0430\u0433\u043d\u0443\u043b \u0432\u043f\u0435\u0440\u0451\u0434 \u0432 \u0441\u0435\u0440\u0438\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 Python 3, \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043c\u0438\u0440 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c. API <a href=\"https:\/\/docs.python.org\/3\/c-api\/index.html\">Python\/C<\/a> \u0442\u043e\u0436\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u043b\u0441\u044f, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0448\u043b\u0438 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0434\u0438\u0438 <code>DeprecationWarning<\/code>. \u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b&#8230;<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PVS-Studio<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PVS-Studio. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u0441 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/download\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1246\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f \u2014 \u0435\u0451 \u0442\u0440\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1246\">\u043f\u043e \u0449\u0435\u043b\u0447\u043a\u0443 \u043c\u044b\u0448\u0438<\/a> \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0430\u043a\u043a\u043e\u0440\u0434\u0443 \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438 \u043f\u043e \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u043b\u0435\u0433\u043a\u043e: \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f Visual Studio 2022. \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f PVS-Studio \u2014 7.35.<\/p>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/h3>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043d\u0430 \u043d\u0430\u0448 \u0441\u0442\u043e\u043b \u043f\u043e\u043f\u0430\u043b \u0433\u043e\u0442\u043e\u0432\u044f\u0449\u0438\u0439\u0441\u044f \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 \u0440\u0435\u043b\u0438\u0437 CPython 3.13.3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0437\u044f\u043b\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/python\/cpython\/tree\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\">e6dfa9d<\/a>. \u041e\u0431\u044b\u0447\u043d\u043e \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0432 &#171;\u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439&#187; (Debug) \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u0435\u043d\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u043e \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 &#171;\u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439&#187; (Release), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 CPython 3 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 Windows: \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>PCbuild<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0438\u0437 \u043d\u0435\u0451 \u0444\u0430\u0439\u043b <code>get_externals.bat<\/code>. \u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430.<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/h3>\n<p>\u0412 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435 <code>PCbuild<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u044f <code>pcbuild.sln<\/code>, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 CPython. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f batch-\u0444\u0430\u0439\u043b <code>get_externals.bat<\/code>, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u0430 \u043f\u0430\u043f\u043e\u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">D:\\Git\\cpython\\PCbuild&gt;get_externals.bat Using py -3.12 (found 3.12 with py.exe) Fetching external libraries... Fetching bzip2-1.0.8... Fetching mpdecimal-4.0.0... Fetching sqlite-3.45.3.0... Fetching xz-5.2.5... Fetching zlib-1.3.1... Fetching external binaries... Fetching libffi-3.4.4... Fetching openssl-bin-3.0.15... Fetching tcltk-8.6.15.0... Finished. <\/code><\/pre>\n<p>\u041d\u0435 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 <code>externals<\/code>, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0443\u044e\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u044b\u0448\u0435. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0451 \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 Visual Studio, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a: <strong>Extensions &gt; PVS-Studio &gt; Options &gt; Don&#8217;t Check Files<\/strong>. \u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0435 \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0430\u043f\u043a\u0438 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/6640\/\">\u0432 \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">D:\\Git\\cpython\\externals\\ <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0436, \u043b\u0435\u0437\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u044c&#8230;<\/p>\n<h4>MD5 \u0432\u0441\u0435\u043b\u044f\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c&#8230;<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;p&#8217;. Check lines: 1174, 1173. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1174\">Hacl_Hash_MD5.c 1174<\/a><\/p>\n<pre><code class=\"cpp\">#ifndef KRML_HOST_MALLOC #  define KRML_HOST_MALLOC malloc #endif  Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_malloc(void) {   ....   Hacl_Streaming_MD_state_32   *p = (Hacl_Streaming_MD_state_32 *)         KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));   p[0U] = s;                                                   \/\/ &lt;=   .... } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 1415, 1414. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1415\">Hacl_Hash_MD5.c 1415<\/a><\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument. Check lines: 1417, 1416. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_hacl\/Hacl_Hash_MD5.c#L1417\">Hacl_Hash_MD5.c 1417<\/a><\/p>\n<pre><code class=\"cpp\">#ifndef KRML_HOST_CALLOC #  define KRML_HOST_CALLOC calloc #endif  Hacl_Streaming_MD_state_32 * Hacl_Hash_MD5_copy(Hacl_Streaming_MD_state_32 *state) {   Hacl_Streaming_MD_state_32 scrut = *state;   uint32_t *block_state0 = scrut.block_state;   uint8_t *buf0 = scrut.buf;   ....   uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC(64U, sizeof (uint8_t));   memcpy(buf, buf0, 64U * sizeof (uint8_t));                         \/\/ &lt;=   uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC(4U, sizeof (uint32_t));   memcpy(block_state, block_state0, 4U * sizeof (uint32_t));         \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u043e\u0448\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0443\u0447\u043d\u043e. \u041d\u0435\u0442, \u044d\u0442\u0438 \u0442\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 MD5 \u043f\u0440\u0438\u0437\u043d\u0430\u043b\u0438 \u043d\u0435\u043a\u0440\u0438\u043f\u0442\u043e\u0441\u0442\u043e\u0439\u043a\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u0435\u043b\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <code>calloc<\/code>\/<code>malloc<\/code> <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442<\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>memcpy<\/code> \u0441 \u0432\u0438\u0434\u0443 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0430\u044f \u0431\u0443\u043a\u0430\u0448\u043a\u0430. \u041d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u0430\u044f, \u0447\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 MSVC \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/c-runtime-library\/reference\/memcpy-wmemcpy\">\u043f\u043e\u0431\u044c\u0451\u0442 SDL-\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438<\/a> \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 <code>memcpy<\/code> \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043f\u0435\u0442\u044c \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u0440\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 <code>NULL<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u0430 \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430, \u0438 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h4>&#8230;\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2014 \u043d\u0435\u0442?<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;fut-&gt;fut_state != STATE_PENDING&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_asynciomodule.c#L506\">_asynciomodule.c 506<\/a><\/p>\n<pre><code class=\"cpp\">static PyObject * future_set_exception(asyncio_state *state, FutureObj *fut, PyObject *exc) {   PyObject *exc_val = NULL;    if (fut-&gt;fut_state != STATE_PENDING) {           \/\/ &lt;=       PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");       return NULL;   }    if (PyExceptionClass_Check(exc)) {       exc_val = PyObject_CallNoArgs(exc);       if (exc_val == NULL) {         return NULL;       }       if (fut-&gt;fut_state != STATE_PENDING) {      \/\/ &lt;=           Py_DECREF(exc_val);           PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");           return NULL;       }   }   .... } <\/code><\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v547\/\">\u0447\u0430\u0441\u0442\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439<\/a>. \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <code>fut-&gt;fut_state<\/code>:<\/p>\n<pre><code class=\"cpp\">if (fut-&gt;fut_state != STATE_PENDING) {           \/\/ &lt;=     PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");     xreturn NULL; } <\/code><\/pre>\n<p>\u041c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u0434\u043e \u043b\u0438 \u043d\u0430\u043c \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435&#8230; \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>fut-&gt;fut_state<\/code>? \u041d\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u0442\u0430\u043c <code>STATE_PENDING<\/code>! \u0412 \u0438\u0442\u043e\u0433\u0435 \u043b\u0438\u0448\u043d\u044f\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0441\u0435\u0442\u044c. \u0423\u043f\u043b\u043e\u0449\u0430\u0435\u043c \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (PyExceptionClass_Check(exc)) {     exc_val = PyObject_CallNoArgs(exc);     if (exc_val == NULL) {       return NULL;     }     Py_DECREF(exc_val);     PyErr_SetString(state-&gt;asyncio_InvalidStateError, \"invalid state\");     return NULL; } <\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0441\u0445\u043e\u0436\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1156\">1156<\/a><\/p>\n<\/li>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1190\">1190<\/a><\/p>\n<\/li>\n<li>\n<p>V547 Expression &#8216;start_state != deque-&gt;state&#8217; is always false. _collectionsmodule.c <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_collectionsmodule.c#L1450\">1450<\/a><\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;error_handler == _Py_ERROR_UNKNOWN&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Objects\/unicodeobject.c#L15765\">unicodeobject.c 15765<\/a><\/p>\n<p>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">static _Py_error_handler get_error_handler_wide(const wchar_t *errors) {     if (errors == NULL || wcscmp(errors, L\"strict\") == 0) {         return _Py_ERROR_STRICT;     }     if (wcscmp(errors, L\"surrogateescape\") == 0) {         return _Py_ERROR_SURROGATEESCAPE;     }     if (wcscmp(errors, L\"replace\") == 0) {         return _Py_ERROR_REPLACE;     }     if (wcscmp(errors, L\"ignore\") == 0) {         return _Py_ERROR_IGNORE;     }     if (wcscmp(errors, L\"backslashreplace\") == 0) {         return _Py_ERROR_BACKSLASHREPLACE;     }     if (wcscmp(errors, L\"surrogatepass\") == 0) {         return _Py_ERROR_SURROGATEPASS;     }     if (wcscmp(errors, L\"xmlcharrefreplace\") == 0) {         return _Py_ERROR_XMLCHARREFREPLACE;     }     return _Py_ERROR_OTHER; }  static int init_fs_codec(PyInterpreterState *interp) {     const PyConfig *config = _PyInterpreterState_GetConfig(interp);      _Py_error_handler error_handler;     error_handler = get_error_handler_wide(config-&gt;filesystem_errors);     if (error_handler == _Py_ERROR_UNKNOWN) {                              \/\/ &lt;=         PyErr_SetString(PyExc_RuntimeError, \"unknown filesystem error handler\");         return -1;     }     .... } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u0437\u0430\u043f\u0430\u0445 \u043f\u043e\u0434\u0433\u043e\u0440\u0435\u0432\u0448\u0435\u0439 \u0447\u0435\u0448\u0443\u0438, \u0432\u044b \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438 \ud83d\ude42 \u0415\u0441\u043b\u0438 \u043d\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435, \u043d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0451 \u043f\u043e\u043a\u0430\u0436\u0435\u043c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>get_error_handler_wide<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 <code>_Py_ERROR_UNKNOWN<\/code>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0438\u0434\u0451\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430. \u0418\u0437 \u043d\u0435\u0451 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0439\u0442\u0438 \u0441 \u044d\u0442\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c: \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 <strong>\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f<\/strong> \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 <code>return<\/code> \u0441 \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u0420\u0430\u0437 \u0443 \u043d\u0430\u0441 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0441\u044e\u0436\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u043e\u0432\u043e\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435? \u0425\u043c-\u043c-\u043c&#8230;<\/p>\n<pre><code class=\"cpp\">typedef enum {     _Py_ERROR_UNKNOWN=0,          \/\/ &lt;=     _Py_ERROR_STRICT,     _Py_ERROR_SURROGATEESCAPE,     _Py_ERROR_REPLACE,     _Py_ERROR_IGNORE,     _Py_ERROR_BACKSLASHREPLACE,     _Py_ERROR_SURROGATEPASS,     _Py_ERROR_XMLCHARREFREPLACE,     _Py_ERROR_OTHER } _Py_error_handler; <\/code><\/pre>\n<p>\u041e\u0439, \u0430 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 <s>\u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f<\/s> \u043d\u0435\u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430. \u041c\u043e\u0436\u043d\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e &#171;\u043f\u0440\u043e\u0447\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438&#187; \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c &#171;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430&#187;, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c &#171;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443&#187;, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c &#171;\u043f\u0440\u043e\u0447\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430&#187;? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u0434\u0443\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043e\u043d\u0438 \u0432\u0441\u0435 \u043c\u0438\u043c\u043e.<\/p>\n<figure class=\"\"><\/figure>\n<h4>\u041e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439<\/h4>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 PVS-Studio:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;capi == NULL&#8217; is always false. <a href=\"https:\/\/github.com\/python\/cpython\/blob\/e6dfa9d6013018c1f5d8e3a72b73cdab2a5664c2\/Modules\/_datetimemodule.c#L7236\">_datetimemodule.c 7236<\/a><\/p>\n<pre><code class=\"cpp\">\/* The C-API is process-global.  This violates interpreter isolation  * due to the objects stored here.  Thus each of those objects must  * be managed carefully. *\/ \/\/ XXX Can we make this const? static PyDateTime_CAPI capi = {     .... }  \/* Get a new C API by calling this function.  * Clients get at C API via PyDateTime_IMPORT, defined in datetime.h.  *\/ static inline PyDateTime_CAPI * get_datetime_capi(void) {     return &amp;capi; }  static int _datetime_exec(PyObject *module) {     ....     \/* At last, set up and add the encapsulated C API *\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-456499","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456499","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=456499"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456499\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}