fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.8K
active users

#cpython

6 posts6 participants0 posts today
GripNews<p>🌘 探索 CPython 3.14 的遠端偵錯協定<br>➤ CPython 3.14 遠端偵錯功能的實用指南<br>✤ <a href="https://rtpg.co/2025/06/28/checking-out-sys-remote-exec/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">rtpg.co/2025/06/28/checking-ou</span><span class="invisible">t-sys-remote-exec/</span></a><br>CPython 3.14 引入了一項新功能,允許將 Python 程式碼注入到正在運行的進程中,藉此簡化了遠端偵錯流程。過去,Python 的偵錯工具通常需要修改原始碼並重新啟動程式才能進行偵錯。現在,透過 `sys.remote_exec`,我們可以直接向運行的進程發送並執行程式碼,而無需重新啟動。此功能降低了偵錯工具開發的門檻,並提供了更便捷的偵錯體驗。<br>+ 終於不用為了偵錯而頻繁修改程式碼再重啟了,這真是太方便了!<br>+ 這個功能讓我想起以前用 gdb 偵錯 C++ 的日子,Python 終於也能做到類似的功能了。<br><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/%E5%81%B5%E9%8C%AF" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>偵錯</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> 3.14</p>
danzin<p>Busy day, good day: the new CPython fuzzer lafleur found its first 2 crashes this morning! </p><p>Happiness only marred by the bad job I did reducing the testcases and making the reports reproducible. Thanks Brandt Bucher and and Ken Jin for the patience! Next bug reports will be more polished and reliable.</p><p>Also, we got 3 new PRs for the fuzzer but I didn't have time to review them, will have to leave that for tomorrow.</p><p><a href="https://github.com/devdanzin/lafleur/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/devdanzin/lafleur/</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzer</span></a> <a href="https://mastodon.social/tags/fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzing</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a> <a href="https://mastodon.social/tags/lafleur" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lafleur</span></a></p>
Hugo van Kemenade<p>Just released: Python 3.14.0 release candidate 1! 🚀🐍</p><p>🫖 T-strings!</p><p>🧵 Free-threading is officially supported!</p><p>🚇 Subinterpreters in the stdlib!</p><p>🗜️ Zstandard compression!</p><p>🎨 REPL syntax highlighting and tab autocomplete!</p><p>⚠️ Better error messages!</p><p>📦 Are you a package maintainer? Prepare for 3.14 and report bugs!</p><p>🛞 No ABI changes: upload 3.14 wheels to PyPI</p><p>🥧 And much, much more!</p><p><a href="https://discuss.python.org/t/python-3-14-release-candidate-1-is-go/99754?u=hugovk" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discuss.python.org/t/python-3-</span><span class="invisible">14-release-candidate-1-is-go/99754?u=hugovk</span></a><br><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/Python314" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python314</span></a> <a href="https://mastodon.social/tags/release" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>release</span></a></p>
Hugo van Kemenade<p>Thanks to everyone for taking part in the <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> sprint at <a href="https://mastodon.social/tags/EuroPython2025" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>EuroPython2025</span></a>! </p><p>Across all CPython repos this weekend:</p><p>* 122 PRs created (69 the previous weekend)<br>* 79 PRs merged (65) <br>* countless invaluable in-person discussions (a few?)</p><p><a href="https://mastodon.social/tags/EuroPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>EuroPython</span></a> <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/sprint" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sprint</span></a> <a href="https://mastodon.social/tags/Prague" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Prague</span></a></p>
danzin<p>Launching a new project on a Sunday night: lafleur, a CPython JIT fuzzer.</p><p><a href="https://github.com/devdanzin/lafleur" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/devdanzin/lafleur</span><span class="invisible"></span></a></p><p>It's a feedback driven fuzzer (using JIT debug output) with corpus prioritization and JIT-targeted AST-based mutations. Calling it "evolutionary" may be a stretch, but sounds good.</p><p>It's also a fuzzer that so far hasn't found any crashes or bugs. Still working on that ;)</p><p>If you want to understand how it works, there is a good amount of docs.</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/lafleur" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lafleur</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a> <a href="https://mastodon.social/tags/Fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fuzzer</span></a> <a href="https://mastodon.social/tags/Fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fuzzing</span></a> <a href="https://mastodon.social/tags/JIT" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JIT</span></a></p>
Habr<p>CPython — бессмертные Immortal объекты</p><p>Начиная с версии 3.12 Python поддерживает такой тип объектов, как бессмертные ( Immortal ). Бессмертными объектами являются глобальные константы, такие как None , False , True , а также некоторые другие объекты. Если вам интересно, что это за объекты, как ими становятся обычные смертные, где они используются и как повлияли на CPython — добро пожаловать.</p><p><a href="https://habr.com/ru/articles/929228/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/929228/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://zhub.link/tags/cpython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpython</span></a> <a href="https://zhub.link/tags/subinterpreters" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>subinterpreters</span></a> <a href="https://zhub.link/tags/%D0%BA%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D0%B5%D0%BA%D1%81%D1%82" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>космотекст</span></a></p>
danzin<p>Trying real hard to build a fuzzer targeting the CPython JIT, lots of features implemented but not a single crash or bug discovered so far.</p><p>Such is life when hunting for crashes in robust code.</p><p>This weekend I'll be spinning off a new fuzzer that grew from fusil. Wish me luck 🙂</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/JIT" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JIT</span></a> <a href="https://mastodon.social/tags/Fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fuzzer</span></a> <a href="https://mastodon.social/tags/Fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fuzzing</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a> <a href="https://mastodon.social/tags/lafleur" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lafleur</span></a></p>
Paolo Melchiorre<p>Diego Russo, Python Core Developer, is speaking about &quot;Exploring the CPython JIT&quot; in the main hall of EuroPython 2025 🐍</p><p><a href="https://fosstodon.org/tags/EuroPython" class="mention hashtag" rel="tag">#<span>EuroPython</span></a> <a href="https://fosstodon.org/tags/EuroPython2025" class="mention hashtag" rel="tag">#<span>EuroPython2025</span></a> <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="tag">#<span>Python</span></a> <a href="https://fosstodon.org/tags/CPython" class="mention hashtag" rel="tag">#<span>CPython</span></a> <a href="https://fosstodon.org/tags/JIT" class="mention hashtag" rel="tag">#<span>JIT</span></a> <a href="https://fosstodon.org/tags/Compilers" class="mention hashtag" rel="tag">#<span>Compilers</span></a> </p><p><a href="https://ep2025.europython.eu/session/exploring-the-cpython-jit" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">ep2025.europython.eu/session/e</span><span class="invisible">xploring-the-cpython-jit</span></a></p><p>CC <span class="h-card" translate="no"><a href="https://fosstodon.org/@europython" class="u-url mention">@<span>europython</span></a></span></p>
Hugo van Kemenade<p>Just released: Python 3.14.0 beta 4! 🚀🐍</p><p>🥧 Last beta!</p><p>🥧 Do you maintain a Python package? Please test and report bugs!</p><p>🥧 This includes creating pre-release wheels for 3.14, as it helps other projects to do their own testing.</p><p><a href="https://discuss.python.org/t/python-3-14-0-beta-4-is-here/98092/1?u=hugovk" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discuss.python.org/t/python-3-</span><span class="invisible">14-0-beta-4-is-here/98092/1?u=hugovk</span></a><br><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/Python314" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python314</span></a> <a href="https://mastodon.social/tags/release" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>release</span></a></p>
Hacker News<p>Reflections on 2 years of CPython's JIT Compiler: The good, the bad, the ugly</p><p><a href="https://fidget-spinner.github.io/posts/jit-reflections.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">fidget-spinner.github.io/posts</span><span class="invisible">/jit-reflections.html</span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/JIT" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JIT</span></a> <a href="https://mastodon.social/tags/Compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compiler</span></a> <a href="https://mastodon.social/tags/Reflections" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Reflections</span></a> <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/Development" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Development</span></a> <a href="https://mastodon.social/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://mastodon.social/tags/Community" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Community</span></a> <a href="https://mastodon.social/tags/Technology" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Technology</span></a> <a href="https://mastodon.social/tags/Insights" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Insights</span></a></p>
Hugo van Kemenade<p><span class="h-card" translate="no"><a href="https://mastodon.social/@treyhunner" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>treyhunner</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@webology" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>webology</span></a></span> Likewise! Worktrees are useful for projects like CPython where we have `main`, `3.14`, `3.13` branches and so on.</p><p>The guide I wrote:</p><p><a href="https://devguide.python.org/getting-started/git-boot-camp/#git-worktree" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">devguide.python.org/getting-st</span><span class="invisible">arted/git-boot-camp/#git-worktree</span></a><br><a href="https://mastodon.social/tags/Git" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Git</span></a> <a href="https://mastodon.social/tags/worktree" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worktree</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a></p>
Habr<p>[Перевод] Самый быстрый способ нахождения гласной в строке</p><p>Недавно меня заинтересовала такая задача: как лучше всего определить, что в строке есть гласная? Казалось бы, тривиальный вопрос, правда? Но, начав разбираться, я осознал, что задача гораздо глубже. Я бросил себе вызов: придумать как можно больше способов обнаружения гласной. Я даже попросил присоединиться ко мне нескольких друзей. Какой способ самый быстрый? Каким никогда не стоит пользоваться? Какой самый умный? Какой самый удобочитаемый? В этом посте я рассмотрю 11 способов обнаружения гласных, алгоритмический анализ, дизассемблирование байт-кода Python, реализацию CPython и даже исследую опкоды скомпилированного регулярного выражения. Поехали!</p><p><a href="https://habr.com/ru/companies/ruvds/articles/920932/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">habr.com/ru/companies/ruvds/ar</span><span class="invisible">ticles/920932/</span></a></p><p><a href="https://zhub.link/tags/%D1%80%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D1%8B%D0%B5_%D0%B2%D1%8B%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>регулярные_выражения</span></a> <a href="https://zhub.link/tags/%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0_%D1%81%D0%BE_%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B0%D0%BC%D0%B8" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>работа_со_строками</span></a> <a href="https://zhub.link/tags/cpython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpython</span></a> <a href="https://zhub.link/tags/%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>строки</span></a></p>
Habr<p>Как привинтить Python к Go</p><p>Здравствуйте, Меня зовут Александр Певзнер, и я программирую на Си и Go. Go обычно ассоциируется с бакендом, микросервисами и вот этим вот всем. Но я использую его необычным образом: я пишу на нём системное ПО. Почему я это делаю именно на Go? Этот язык привлекает меня своей простотой, лаконичностью, ясной семантикой, прекрасной документацией и великолепной стандартной библиотекой. Одна из моих программ, ipp-usb , написанная на Go, входит во все дистрибутивы Linux и *BSD и делает возможным использование принтеров и сканеров, которые подключаются к USB и поддерживают IPP over USB протокол - т.е., примерно всех современных. А еще я член OpenPrinting - небольшой, но очень плодотворной группы людей, которая ответственна за печать и, отчасти, сканирование на всех UNIX-like OS и за формирование индустриальных стандартов в этой области. Это всё начиналось для меня, как хобби, но сейчас это - часть моей оплачиваемой работы. В силу особенностей моей работы меня не очень интересуют такие вещи, как поддержка миллиона запросов в секунду и прочий high load (это не значит, что мои программы тормозные. Но никто не дёргает системный принтер миллион раз в секунду). Но зато приходится разбираться с некоторыми другими непростыми штуками. Об одной из таких штук и пойдёт речь в этой статье. Понадобился мне для одного проекта на Go встроенный скриптинг. Ну т.е., чтобы программа могла всосать в себя скрипт, который определяет некоторые аспекты её поведения. Размышляя о том, на каком языке программа должна скриптоваться, в выбирал между JS , Lua и Python . Однако, JS и Lua - слишком нишевые языки. JS ассоциируется у всех с вебом а Lua - с разработкой игр. Таким образом, выбор естественным образом пал на Python . Этот язык знают все, а я испытываю некоторую надежду, что скрипты для моей программы буду писать не только я. Хотя сам я, должен признаться, Python не знаю и не люблю :) Таким образом, осталось только придумать, как встроить интерпретатор Python -а в программу на Go . Об этом и пойдёт речь в этой публикации</p><p><a href="https://habr.com/ru/articles/919590/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/919590/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/go" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>go</span></a> <a href="https://zhub.link/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://zhub.link/tags/scripting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>scripting</span></a> <a href="https://zhub.link/tags/embedded" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>embedded</span></a> <a href="https://zhub.link/tags/cpython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpython</span></a> <a href="https://zhub.link/tags/%D0%B2%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9_%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BF%D1%80%D0%B5%D1%82%D0%B0%D1%82%D0%BE%D1%80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>встроенный_интерпретатор</span></a></p>
Hugo van Kemenade<p>Just released: Python 3.14.0 beta 3! 🚀🐍</p><p>🥧 All the good stuff of b2 but also:</p><p>🥧 Free-threaded Python is officially supported! (PEP 779)</p><p>🥧 Subinterpreters in the stdlib! (PEP 734)</p><p>Do you maintain a Python package? Please test 3.14.</p><p>If you find a bug now, we can fix it before October, which helps everyone. And you might find some places in your code to update as well, which helps you.</p><p><a href="https://discuss.python.org/t/python-3-14-0-beta-3-is-here/95843?u=hugovk" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discuss.python.org/t/python-3-</span><span class="invisible">14-0-beta-3-is-here/95843?u=hugovk</span></a></p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/Python314" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python314</span></a> <a href="https://mastodon.social/tags/release" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>release</span></a> <a href="https://mastodon.social/tags/PEP779" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PEP779</span></a> <a href="https://mastodon.social/tags/PEP734" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PEP734</span></a> <a href="https://mastodon.social/tags/FreeThreaded" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreeThreaded</span></a> <a href="https://mastodon.social/tags/subinterpreters" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>subinterpreters</span></a></p>
mgorny-nyan (on) :autism:🙀🚂🐧<p>Ciekawostki o Pythonowym "limited API" i "stable ABI".</p><p>1. <a href="https://pol.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> ma "limited API". Jak się tego używa, to kompilowane rozszerzenia są zgodne ze wskazaną wersją i wersjami nowszymi. Takie rozszerzenia dostają sufiks `.abi3.so` (albo podobny) zamiast np. `.cpython-313-x86_64-linux-gnu.so`.</p><p>2. Wsparcie podzielone jest między CPythona i systemy budowania <a href="https://pol.social/tags/PEP517" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PEP517</span></a>. Np. w <a href="https://pol.social/tags/setuptools" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>setuptools</span></a> podaje się `py_limited_api=`, i wówczas przy budowaniu dodawane są odpowiednie flagi kompilatora i podmieniany jest sufiks rozszerzeń. <a href="https://pol.social/tags/Meson" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Meson</span></a> ma coś podobnego.</p><p>3. Ale wersja "freethreading" aktualnie nie obsługuje "stable ABI", więc przy budowaniu z "limited API" dostaje się błąd kompilacji. Podobnie, setuptools rzuca błąd jeżeli z interpreterem freethreading podamy `py_limited_api`, a Meson po prostu pozwala się wysypać kompilacji. Tak więc autorzy paczek muszą sami sprawdzać, czy użyto kompilatora "freethreading", i wyłączyć wówczas "limited API".</p><p>4. Bliżej nieokreślona przyszła wersja CPythona naprawi to wsparcie. Nie przyglądałem się tematowi dokładnie, ale podejrzewam, że będzie to tylko możliwe,&nbsp;jeżeli będziemy budować rozszerzenia dla tej bądź nowszej wersji. Więc ludzie pewnie będą musieli budować dwie wersje — tę dla starszych CPythonów, i dla nowszych + "freethreading". No i oczywiście będzie trzeba odpowiednio zaktualizować warunkowe załączanie "limited API".</p><p>5. No i jest jeszcze <a href="https://pol.social/tags/PyPy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyPy</span></a>. PyPy nie ma "stable ABI", ale pozwala budować rozszerzenia z "limited API". Setuptools i Meson po prostu wykrywają, że interpreter nie obsługuje sufiksu `.abi3.so`, i buduje rozszerzenia z normalnym sufiksem.</p><p><a href="https://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
mgorny-nyan (he) :autism:🙀🚂🐧<p>Some fun facts about <a href="https://social.treehouse.systems/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> limited API / stable ABI.</p><p>1. <a href="https://social.treehouse.systems/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> supports "limited API". When you use it, you get extensions that are compatible with the specified CPython version and versions newer than that. To indicate this compatibility, such extensions use `.abi3.so` suffix (or equivalent) rather than the usual `.cpython-313-x86_64-linux-gnu.so` or alike.</p><p>2. The actual support is split between CPython itself and <a href="https://social.treehouse.systems/tags/PEP517" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PEP517</span></a> build systems. For example, if you use <a href="https://social.treehouse.systems/tags/setuptools" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>setuptools</span></a> and specify `py_limited_api=` argument to the extension, setuptools will pass appropriate C compiler flags and swap extension suffix. There's a similar support in <a href="https://social.treehouse.systems/tags/meson" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>meson</span></a>, and probably other build systems.</p><p>3. Except that CPython freethreading builds don't support stable ABI right now, so building with "limited API" triggers an explicit error from the headers. Setuptools have opted for building explicit about this: it emits an error if you try to use `py_limited_api` on a freethreading interpreter. Meson currently just gives the compile error. This implies that package authors need to actively special-case freethreading builds and enable "limited API" conditionally.</p><p>4. A some future versions of CPython will support "limited API" in freethreading builds. I haven't been following the discussions closely, but I suspect that it will only be possible when you target that version or newer. So I guess people will need to be building two stable ABI wheels for a time — one targeting older Python versions, and one targeting newer versions plus freethreading. On top of that, all these projects will need to update their "no 'limited API' on freethreading" conditions.</p><p>5. And then there's <a href="https://social.treehouse.systems/tags/PyPy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyPy</span></a>. PyPy does not feature a stable ABI, but it allows you to build extensions using "limited API". So setuptools and meson just detect that there is no `.abi3.so` on PyPy, and use regular suffix for the extensions built with "limited API".</p>
danzin<p>So, what's next for fuzzing CPython with fusil?</p><p>The results point to interesting future ideas, including expanding fuzzing to new environments like subinterpreters, using more tools like Thread Sanitizer, and developing more advanced fuzzing techniques.</p><p>A huge thank you to everyone who contributed!</p><p>And thank you for reading!</p><p>P.S.: if you have a C/Rust extension, we can fuzz it too: <a href="https://mastodon.social/@danzin/114383188014599269" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mastodon.social/@danzin/114383</span><span class="invisible">188014599269</span></a></p><p>(5/5)</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzing</span></a> <a href="https://mastodon.social/tags/fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzer</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a></p>
danzin<p>One finding I really like is the bug discovery pattern.</p><p>There wasn't a steady stream of bugs, but spikes of findings: 1st, a huge number of crashes as I started testing a CPython that hadn't been fuzzed by fusil in a decade.</p><p>Later, a new wave of issues tied to the addition of new features to the fuzzer, like support for "weird classes" and typing objects.</p><p>So periodic campaigns may have better cost-benefit than continuous fuzzing.</p><p>(4/5)</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzing</span></a> <a href="https://mastodon.social/tags/fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzer</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a></p>
danzin<p>The credit for fusil's effective design goes all to Victor Stinner (<span class="h-card" translate="no"><a href="https://mamot.fr/@vstinner" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>vstinner</span></a></span>), who created it nearly two decades ago. It was responsible for finding release blockers way back in 2008. I just contributed a little to revive and enhance it. </p><p>Some enhancements included running generated code in threads and adopting new "interesting" objects and values as inputs, helping to discover more crashes.</p><p>(3/5)</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzing</span></a> <a href="https://mastodon.social/tags/fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzer</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a></p>
danzin<p>All this was only possible due to the great response from the Python community.</p><p>Thanks to the developers efforts to triage, diagnose, and fix the problems, the campaign became a collaborative effort to improve Python.</p><p>The impact was considerable, mobilizing Core Devs and contributors to create 98 PRs to fix these bugs. The average time to fix an issue was about 20 days, with a median of just five days.</p><p>(2/5)</p><p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/fuzzing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzing</span></a> <a href="https://mastodon.social/tags/fuzzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fuzzer</span></a> <a href="https://mastodon.social/tags/fusil" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fusil</span></a></p>