Skip to content

Dedent -c code argument - #8056

Merged
youknowone merged 3 commits into
RustPython:mainfrom
roryyorke:rory/test_cmd_line
Jun 16, 2026
Merged

Dedent -c code argument#8056
youknowone merged 3 commits into
RustPython:mainfrom
roryyorke:rory/test_cmd_line

Conversation

@roryyorke

@roryyorke roryyorke commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

I haven't used AI at all for this. (I'm not sure if an "anti-disclaimer" is needed...)

Summary

  • dedents -c code argument
  • removes expectedFailure marker from test.test_cmd_line.CmdLineTest.test_cmd_dedent
  • updated expectedFailure comment for test.test_os.ExecTests.test_execve_env_concurrent_mutation_with_fspath_posix, which used to fail with IndentationError, but now fails with a TypeError.

Summary by CodeRabbit

  • Bug Fixes
    • Improved -c command-line argument handling by automatically stripping common leading indentation from multi-line commands, ensuring consistently normalized execution when commands are formatted with extra whitespace.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 1412010d-22c6-41f8-b18d-22a2b977fbf2

📥 Commits

Reviewing files that changed from the base of the PR and between 31d9128 and 60f10b2.

⛔ Files ignored due to path filters (2)
  • Lib/test/test_cmd_line.py is excluded by !Lib/**
  • Lib/test/test_os.py is excluded by !Lib/**
📒 Files selected for processing (1)
  • src/settings.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/settings.rs

📝 Walkthrough

Walkthrough

The -c option now preprocesses its argument with a new dedent() helper that removes a common leading whitespace prefix across non-empty lines before storing the command in RunMode::Command.

Changes

Command-line -c dedent preprocessing

Layer / File(s) Summary
Dedent helper implementation
src/settings.rs
A private dedent() helper (lines 472–538) converts all-whitespace lines to empty, computes the common leading whitespace prefix across non-empty lines, strips that prefix from each non-empty line, and joins lines with \n.
-c argument integration
src/settings.rs
The -c parser (around lines 125–129) now wraps the input with dedent() when constructing RunMode::Command, so the stored command string is the dedented version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A dedent so fine,
Makes -c code shine so bright,
Whitespace stripped away,
CPython's way—
RustPython hops in, all right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Dedent -c code argument' directly and clearly summarizes the main change: adding dedenting functionality to the -c command-line option.
Linked Issues check ✅ Passed The PR implements dedenting of the -c argument in src/settings.rs via a new dedent() helper function, matching CPython 3.14 behavior as required by #8055. Test files excluded from review but confirmed in PR objectives as updated.
Out of Scope Changes check ✅ Passed All changes in src/settings.rs (dedent helper function and -c preprocessing) are directly related to the linked issue #8055 requirement to implement -c dedenting. No out-of-scope modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] lib: cpython/Lib/typing.py
[ ] test: cpython/Lib/test/test_typing.py (TODO: 3)
[x] test: cpython/Lib/test/test_type_aliases.py
[ ] test: cpython/Lib/test/test_type_annotations.py (TODO: 1)
[x] test: cpython/Lib/test/test_type_params.py (TODO: 4)
[ ] test: cpython/Lib/test/test_genericalias.py

dependencies:

  • typing (native: _typing, collections.abc, sys)
    • collections (native: _collections, _weakref, itertools, sys)
    • functools (native: _functools, _thread)
    • types (native: _types, sys)
    • warnings (native: _contextvars, _thread, _warnings, builtins, sys)
    • abc, annotationlib, contextlib, copyreg, inspect, operator, re

dependent tests: (19 tests)

  • typing: test_annotationlib test_builtin test_copy test_enum test_fractions test_funcattrs test_functools test_genericalias test_grammar test_inspect test_isinstance test_patma test_peg_generator test_pydoc test_pyrepl test_type_aliases test_type_params test_types test_typing

[ ] lib: cpython/Lib/pdb.py
[ ] test: cpython/Lib/test/test_pdb.py (TODO: 50)

dependencies:

  • pdb (native: main, _pyrepl.utils, atexit, builtins, itertools, readline, sys)
    • asyncio (native: _asyncio, _overlapped, _pyrepl.console, _pyrepl.main, _pyrepl.simple_interact, _remote_debugging, _winapi, asyncio.tools, base_events, collections.abc, concurrent.futures, coroutines, errno, events, exceptions, futures, graph, itertools, locks, log, math, msvcrt, protocols, queues, readline, runners, streams, sys, taskgroups, tasks, threads, time, timeouts, transports, unix_events, windows_events)
    • glob (native: itertools, sys)
    • io (native: _io, _thread, errno, msvcrt, sys)
    • json (native: _json, decoder, encoder, json.tool, sys)
    • os (native: nt, os.path, posix, sys)
    • pydoc (native: _pyrepl.pager, builtins, email.message, http.server, importlib._bootstrap, importlib._bootstrap_external, importlib.machinery, importlib.util, pydoc_data.topics, select, sys, time, urllib.parse)
    • rlcompleter (native: main, atexit, builtins, readline)
    • traceback (native: _suggestions, collections.abc, itertools, sys, unicodedata)
    • types, typing, warnings
    • _colorize, argparse, bdb, cmd, code, codeop, contextlib, dis, inspect, linecache, pprint, re, runpy, selectors, shlex, signal, socket, stat, tempfile, textwrap, threading, token, tokenize, weakref

dependent tests: (1 tests)

  • pdb: test_pdb

[ ] lib: cpython/Lib/traceback.py
[ ] test: cpython/Lib/test/test_traceback.py (TODO: 34)

dependencies:

  • traceback

dependent tests: (159 tests)

  • traceback: test_asyncio test_builtin test_code_module test_contextlib test_contextlib_async test_coroutines test_dictcomps test_exceptions test_http_cookiejar test_importlib test_iter test_listcomps test_pyexpat test_setcomps test_socket test_ssl test_subprocess test_sys test_threadedtempfile test_threading test_traceback test_unittest test_with test_zipimport
    • code:
      • pdb: test_pdb
      • sqlite3.main: test_sqlite3
    • concurrent.futures.process: test_compileall test_concurrent_futures
    • http.cookiejar: test_urllib2
      • urllib.request: test_pathlib test_pydoc test_sax test_site test_urllib test_urllib2_localnet test_urllib2net test_urllibnet
    • logging: test_asyncio test_decimal test_genericalias test_hashlib test_logging test_pkgutil test_support test_unittest
      • hashlib: test_hmac test_smtplib test_tarfile test_unicodedata
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • venv: test_venv
    • multiprocessing: test_fcntl test_memoryview test_multiprocessing_main_handling test_re
    • py_compile: test_argparse test_cmd_line_script test_importlib test_modulefinder test_py_compile test_runpy
      • zipfile: test_shutil test_zipapp test_zipfile test_zipfile64 test_zipimport_support
    • pydoc: test_enum
      • xmlrpc.server: test_docxmlrpc test_xmlrpc
    • socketserver: test_imaplib test_socketserver test_wsgiref
    • threading: test_android test_asyncio test_bytes test_bz2 test_code test_concurrent_futures test_context test_ctypes test_email test_fork1 test_frame test_ftplib test_functools test_gc test_httplib test_httpservers test_importlib test_inspect test_io test_itertools test_largefile test_linecache test_opcache test_pathlib test_poll test_poplib test_pyrepl test_queue test_robotparser test_sched test_signal test_sqlite3 test_super test_syslog test_termios test_threading_local test_time test_weakref test_winreg test_zstd
      • bdb: test_bdb
      • dummy_threading: test_dummy_threading
      • importlib.util: test_asdl_parser test_ctypes test_doctest test_importlib test_reprlib
      • queue: test_dummy_thread
      • subprocess: test_asyncio test_atexit test_audit test_c_locale_coercion test_cmd_line test_ctypes test_dtrace test_embed test_faulthandler test_file_eintr test_gzip test_json test_launcher test_msvcrt test_ntpath test_os test_osx_env test_peg_generator test_platform test_plistlib test_pyrepl test_quopri test_regrtest test_repl test_script_helper test_select test_sys_settrace test_sysconfig test_tempfile test_unittest test_utf8_mode test_wait3 test_webbrowser test_xpickle
      • sysconfig: test_posix test_tools
      • trace: test_trace
    • timeit: test_timeit

[x] lib: cpython/Lib/decimal.py
[ ] lib: cpython/Lib/_pydecimal.py
[ ] test: cpython/Lib/test/test_decimal.py (TODO: 1)

dependencies:

  • decimal (native: _decimal, itertools, math, sys)
    • _pydecimal
    • _pydecimal (native: itertools, math, sys)
    • locale (native: _locale, builtins, encodings.aliases, sys)
    • collections
    • contextvars, numbers, re

dependent tests: (73 tests)

  • decimal: test_asyncio test_buffer test_builtin test_compare test_configparser test_decimal test_fractions test_fstring test_itertools test_json test_locale test_math test_numeric_tower test_operator test_os test_statistics test_time test_tokenize test_tomllib test_xmlrpc
    • fractions: test_float test_random test_string
      • statistics: test_signal
    • statistics:
      • random: test_asyncio test_bisect test_bz2 test_collections test_complex test_context test_dbm_dumb test_deque test_descr test_devpoll test_dict test_dummy_thread test_email test_functools test_heapq test_hmac test_importlib test_int test_io test_logging test_long test_lzma test_mmap test_ordered_dict test_poll test_posixpath test_pow test_pprint test_queue test_regrtest test_richcmp test_selectors test_set test_shutil test_socket test_sort test_strtod test_struct test_sys test_tarfile test_thread test_threading test_traceback test_unparse test_uuid test_weakref test_zipfile test_zlib test_zstd

[ ] lib: cpython/Lib/glob.py
[x] test: cpython/Lib/test/test_glob.py

dependencies:

  • glob

dependent tests: (56 tests)

  • glob: test_bz2 test_glob test_mailbox test_regrtest test_site test_tokenize test_unicode_file test_zipimport
    • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_httpservers test_importlib test_launcher test_logging test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
      • compileall: test_compileall
      • importlib: test_asdl_parser test_bdb test_cmd_line_script test_codecs test_ctypes test_doctest test_frozen test_hashlib test_importlib test_inspect test_linecache test_modulefinder test_multiprocessing_main_handling test_py_compile test_pyclbr test_pydoc test_reprlib test_sundry test_support test_unittest test_zipfile test_zoneinfo
      • zipapp: test_pdb

[ ] lib: cpython/Lib/enum.py
[ ] test: cpython/Lib/test/test_enum.py (TODO: 4)

dependencies:

  • enum (native: builtins, sys)
    • types
    • inspect

dependent tests: (16 tests)

  • enum: test_argparse test_ast test_enum test_httplib test_json test_patma test_pstats test_pydoc test_signal test_socket test_ssl test_str test_time test_types test_typing test_uuid

[x] lib: cpython/Lib/io.py
[ ] lib: cpython/Lib/_pyio.py
[ ] test: cpython/Lib/test/test_io.py (TODO: 14)
[x] test: cpython/Lib/test/test_bufio.py
[x] test: cpython/Lib/test/test_fileio.py (TODO: 1)
[ ] test: cpython/Lib/test/test_memoryio.py (TODO: 28)

dependencies:

  • io

dependent tests: (108 tests)

  • io: test__colorize test_android test_argparse test_ast test_asyncio test_base64 test_buffer test_bufio test_builtin test_bz2 test_calendar test_cmd test_cmd_line_script test_codecs test_compile test_compileall test_compiler_assemble test_concurrent_futures test_configparser test_contextlib test_csv test_dbm_dumb test_descr test_dis test_email test_enum test_file test_fileinput test_fileio test_ftplib test_generated_cases test_getpass test_gzip test_hashlib test_http_cookiejar test_httplib test_httpservers test_importlib test_inspect test_io test_json test_largefile test_logging test_lzma test_mailbox test_marshal test_memoryio test_memoryview test_mimetypes test_minidom test_multibytecodec test_optparse test_pathlib test_pdb test_peg_generator test_pickle test_pickletools test_platform test_plistlib test_pprint test_print test_profile test_pstats test_pty test_pulldom test_pydoc test_pyexpat test_pyrepl test_quopri test_regrtest test_robotparser test_sax test_shlex test_shutil test_site test_smtplib test_socket test_socketserver test_subprocess test_support test_sys test_tarfile test_tempfile test_threadedtempfile test_timeit test_tokenize test_traceback test_types test_typing test_unittest test_univnewlines test_urllib test_urllib2 test_uuid test_wave test_webbrowser test_winconsoleio test_wsgiref test_xml_dom_xmlbuilder test_xml_etree test_xml_etree_c test_xmlrpc test_xpickle test_zipapp test_zipfile test_zipimport test_zoneinfo test_zstd

[ ] lib: cpython/Lib/imaplib.py
[ ] test: cpython/Lib/test/test_imaplib.py (TODO: 1)

dependencies:

  • imaplib (native: binascii, errno, sys, time)
    • io, warnings
    • calendar, datetime, getopt, getpass, hmac, random, re, socket, ssl, subprocess

dependent tests: (1 tests)

  • imaplib: test_imaplib

[ ] lib: cpython/Lib/ntpath.py
[x] test: cpython/Lib/test/test_ntpath.py

dependencies:

  • ntpath (native: _winapi, nt, sys)
    • os
    • genericpath, re

dependent tests: (51 tests)

  • ntpath: test_httpservers test_ntpath test_pathlib
    • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_logging test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
      • compileall: test_compileall
      • importlib: test_asdl_parser test_bdb test_cmd_line_script test_codecs test_ctypes test_doctest test_frozen test_hashlib test_importlib test_inspect test_linecache test_modulefinder test_multiprocessing_main_handling test_py_compile test_pyclbr test_pydoc test_reprlib test_sundry test_support test_unittest test_zipfile test_zipimport test_zoneinfo
      • zipapp: test_pdb

[x] test: cpython/Lib/test/test_select.py (TODO: 3)
[ ] test: cpython/Lib/test/test_poll.py (TODO: 1)

dependencies:

dependent tests: (109 tests)

  • select: test_asyncio test_devpoll test_epoll test_exception_hierarchy test_file_eintr test_kqueue test_os test_poll test_pty test_pyrepl test_select test_smtplib test_socket test_socketserver test_ssl test_subprocess
    • http.server: test_httpservers test_logging test_robotparser test_urllib2_localnet test_xmlrpc
      • pydoc: test_enum test_pydoc
      • wsgiref.simple_server: test_wsgiref
      • xmlrpc.server: test_docxmlrpc
    • pty: test_builtin test_ioctl
    • pydoc:
      • pdb: test_pdb
    • selectors: test_asyncio test_selectors
      • asyncio.selector_events: test_asyncio
      • socket: test_asyncio test_ftplib test_httplib test_imaplib test_largefile test_mailbox test_mmap test_pathlib test_poplib test_signal test_smtpnet test_stat test_support test_sys test_timeout test_urllib test_urllib2 test_urllib2net test_urllib_response test_urllibnet
      • subprocess: test_android test_asyncio test_atexit test_audit test_bz2 test_c_locale_coercion test_cmd_line test_cmd_line_script test_ctypes test_dtrace test_embed test_faulthandler test_gc test_gzip test_inspect test_json test_launcher test_msvcrt test_ntpath test_osx_env test_peg_generator test_platform test_plistlib test_py_compile test_pyrepl test_quopri test_regrtest test_repl test_runpy test_script_helper test_shutil test_site test_sqlite3 test_sys_settrace test_sysconfig test_tempfile test_threading test_traceback test_unittest test_utf8_mode test_venv test_wait3 test_webbrowser test_xpickle test_zipfile
    • subprocess:
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • platform: test__locale test__osx_support test_baseexception test_cmath test_fcntl test_math test_mimetypes test_posix test_strptime test_time test_winreg

[x] lib: cpython/Lib/pydoc.py
[ ] lib: cpython/Lib/pydoc_data
[ ] test: cpython/Lib/test/test_pydoc (TODO: 36)

dependencies:

  • pydoc

dependent tests: (5 tests)

  • pydoc: test_enum test_pydoc
    • pdb: test_pdb
    • xmlrpc.server: test_docxmlrpc test_xmlrpc

[x] lib: cpython/Lib/tempfile.py
[ ] test: cpython/Lib/test/test_tempfile.py (TODO: 1)

dependencies:

  • tempfile

dependent tests: (91 tests)

  • tempfile: test_argparse test_ast test_asyncio test_bytes test_bz2 test_cmd_line test_compile test_compileall test_concurrent_futures test_contextlib test_cprofile test_csv test_ctypes test_dis test_doctest test_embed test_ensurepip test_faulthandler test_filecmp test_fileinput test_generated_cases test_genericalias test_hashlib test_httpservers test_importlib test_inspect test_launcher test_linecache test_logging test_mailbox test_modulefinder test_ntpath test_os test_pathlib test_peg_generator test_pickle test_pkg test_pkgutil test_posix test_pstats test_py_compile test_pydoc test_pyrepl test_regrtest test_runpy test_selectors test_shutil test_site test_socket test_string_literals test_subprocess test_support test_sys test_sys_settrace test_tabnanny test_tempfile test_termios test_threadedtempfile test_tokenize test_tomllib test_traceback test_turtle test_urllib test_urllib2 test_urllib_response test_venv test_winconsoleio test_zipapp test_zipfile test_zipfile64 test_zoneinfo test_zstd
    • ctypes.util: test_ctypes
    • multiprocessing.synchronize:
      • concurrent.futures.process: test_concurrent_futures
    • multiprocessing.util: test_asyncio test_concurrent_futures
    • urllib.request: test_http_cookiejar test_sax test_ssl test_urllib2_localnet test_urllib2net test_urllibnet
      • pathlib: test_dbm_sqlite3 test_importlib test_pathlib test_tarfile test_tomllib test_tools test_unparse test_winapi test_zipfile

[ ] lib: cpython/Lib/encodings

dependencies:

  • encodings (native: _codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr, _codecs_tw, _multibytecodec, _win_cp_codecs, binascii, sys, unicodedata, zlib)
    • base64 (native: binascii, sys)
    • io
    • bz2, codecs, quopri, re, stringprep

dependent tests: (158 tests)

  • encodings: test_codecs test_pydoc test_sys
    • codecs: test_charmapcodec test_codeccallbacks test_eof test_exceptions test_importlib test_inspect test_io test_json test_locale test_logging test_multibytecodec test_os test_pdb test_plistlib test_sax test_str
      • json: test_embed test_pyrepl test_subprocess test_sysconfig test_tomllib test_tools test_traceback test_zoneinfo
      • pickle: test_annotationlib test_argparse test_array test_ast test_asyncio test_bool test_builtin test_bytes test_bz2 test_collections test_concurrent_futures test_configparser test_coroutines test_csv test_ctypes test_decimal test_defaultdict test_deque test_descr test_dict test_dictviews test_email test_enum test_enumerate test_fractions test_functools test_generators test_genericalias test_http_cookies test_importlib test_ipaddress test_iter test_itertools test_list test_lzma test_memoryio test_memoryview test_minidom test_opcache test_operator test_ordered_dict test_pathlib test_pickle test_picklebuffer test_pickletools test_platform test_positional_only_arg test_posix test_random test_range test_re test_set test_shelve test_slice test_socket test_statistics test_string test_structseq test_super test_time test_trace test_tuple test_turtle test_type_aliases test_type_params test_types test_typing test_unittest test_uuid test_xml_dom_minicompat test_xml_etree test_xpickle test_zipfile test_zlib test_zoneinfo
      • tokenize: test_linecache test_peg_generator test_tabnanny test_tokenize test_unparse
    • locale: test__locale test_c_locale_coercion test_calendar test_float test_format test_regrtest test_strftime test_strptime test_utf8_mode
      • calendar: test_imaplib
      • gettext: test_gettext
      • site: test_site
      • subprocess: test_android test_asyncio test_atexit test_audit test_cmd_line test_cmd_line_script test_ctypes test_dtrace test_faulthandler test_file_eintr test_gc test_gzip test_json test_launcher test_msvcrt test_ntpath test_osx_env test_peg_generator test_poll test_py_compile test_pyrepl test_quopri test_repl test_runpy test_script_helper test_select test_shutil test_signal test_sqlite3 test_support test_sys_settrace test_tempfile test_threading test_unittest test_urllib2 test_venv test_wait3 test_webbrowser test_zipfile

[ ] test: cpython/Lib/test/test_pwd.py

dependencies:

dependent tests: (159 tests)

  • pwd: test_getpass test_os test_pathlib test_posix test_shutil test_subprocess test_tarfile
    • getpass:
      • imaplib: test_imaplib
    • http.server: test_httpservers test_logging test_robotparser test_urllib2_localnet test_xmlrpc
      • pydoc: test_enum test_pydoc
      • wsgiref.simple_server: test_wsgiref
      • xmlrpc.server: test_docxmlrpc
    • netrc: test_netrc
      • ftplib: test_ftplib test_urllib2
    • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
      • compileall: test_compileall
      • importlib: test_asdl_parser test_bdb test_cmd_line_script test_codecs test_ctypes test_doctest test_frozen test_hashlib test_importlib test_inspect test_linecache test_modulefinder test_multiprocessing_main_handling test_py_compile test_pyclbr test_reprlib test_sundry test_support test_unittest test_zipfile test_zipimport test_zoneinfo
      • zipapp: test_pdb
    • posixpath: test_posixpath
      • fnmatch: test_embed test_fnmatch
      • mimetypes: test_mimetypes
    • shutil: test_argparse test_bz2 test_ctypes test_filecmp test_glob test_importlib test_largefile test_sax test_site test_string_literals test_sysconfig test_unicode_file
      • ctypes.util: test_ctypes
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • tempfile: test_asyncio test_bytes test_cmd_line test_compile test_concurrent_futures test_contextlib test_cprofile test_csv test_dis test_faulthandler test_fileinput test_generated_cases test_genericalias test_importlib test_mailbox test_ntpath test_pickle test_pkg test_pstats test_pyrepl test_regrtest test_selectors test_socket test_sys test_sys_settrace test_tabnanny test_termios test_threadedtempfile test_tokenize test_turtle test_urllib test_urllib_response test_winconsoleio test_zipfile64
      • webbrowser: test_webbrowser
    • subprocess: test_android test_asyncio test_atexit test_audit test_c_locale_coercion test_dtrace test_file_eintr test_gc test_gzip test_json test_msvcrt test_osx_env test_platform test_plistlib test_poll test_pyrepl test_quopri test_repl test_script_helper test_select test_signal test_sqlite3 test_threading test_unittest test_utf8_mode test_wait3 test_xpickle
      • asyncio: test_asyncio test_unittest
      • platform: test__locale test__osx_support test_baseexception test_builtin test_cmath test_fcntl test_math test_ssl test_strptime test_time test_winreg

[x] test: cpython/Lib/test/test_thread.py (TODO: 3)
[x] test: cpython/Lib/test/test_thread_local_bytecode.py
[x] test: cpython/Lib/test/test_threadsignals.py

dependencies:

dependent tests: (13 tests)
- [ ] concurrent.futures: test_asyncio test_compileall test_concurrent_futures test_context test_genericalias test_inspect test_struct test_wmi
- [ ] asyncio: test_asyncio test_logging test_os test_pdb test_unittest

[ ] lib: cpython/Lib/base64.py
[x] test: cpython/Lib/test/test_base64.py

dependencies:

  • base64

dependent tests: (55 tests)

  • base64: test_base64 test_email test_gettext test_http_cookies test_httpservers test_smtplib test_urllib2 test_urllib2_localnet test_xmlrpc test_zoneinfo
    • email.base64mime:
      • smtplib: test_smtpnet
    • http.cookies: test_genericalias
    • http.server: test_logging test_robotparser
      • pydoc: test_enum test_pydoc
      • wsgiref.simple_server: test_wsgiref
      • xmlrpc.server: test_docxmlrpc
    • logging.handlers: test_concurrent_futures test_pkgutil
    • secrets: test_secrets
    • ssl: test_asyncio test_ftplib test_httplib test_imaplib test_poplib test_ssl test_urllib test_venv
      • asyncio.selector_events: test_asyncio
      • urllib.request: test_http_cookiejar test_pathlib test_sax test_site test_urllib2net test_urllibnet
    • urllib.request:
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_peg_generator test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_winapi test_zipapp test_zipfile test_zstd

[ ] lib: cpython/Lib/gzip.py
[x] test: cpython/Lib/test/test_gzip.py

dependencies:

  • gzip (native: builtins, compression._common, errno, sys, time, zlib)
    • io, os, warnings
    • argparse, struct, weakref

dependent tests: (35 tests)

  • gzip: test_fileinput test_tarfile test_xmlrpc
    • fileinput: test_genericalias
    • tarfile: test_shutil
      • shutil: test_argparse test_bz2 test_compileall test_ctypes test_embed test_filecmp test_glob test_httpservers test_importlib test_inspect test_largefile test_launcher test_logging test_modulefinder test_os test_peg_generator test_pkgutil test_py_compile test_reprlib test_sax test_site test_string_literals test_subprocess test_support test_sysconfig test_tempfile test_traceback test_unicode_file test_venv test_zoneinfo

[ ] lib: cpython/Lib/asyncio
[ ] test: cpython/Lib/test/test_asyncio (TODO: 32)

dependencies:

  • asyncio

dependent tests: (6 tests)

  • asyncio: test_asyncio test_inspect test_logging test_os test_pdb test_unittest

[ ] lib: cpython/Lib/ftplib.py
[ ] test: cpython/Lib/test/test_ftplib.py

dependencies:

  • ftplib (native: sys)
    • netrc, re, socket, ssl

dependent tests: (36 tests)

  • ftplib: test_ftplib test_urllib2
    • urllib.request: test_http_cookiejar test_pathlib test_pydoc test_sax test_site test_ssl test_urllib test_urllib2_localnet test_urllib2net test_urllibnet
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_httpservers test_importlib test_launcher test_logging test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd

[ ] lib: cpython/Lib/collections
[ ] lib: cpython/Lib/_collections_abc.py
[x] test: cpython/Lib/test/test_collections.py (TODO: 1)
[ ] test: cpython/Lib/test/test_deque.py (TODO: 2)
[x] test: cpython/Lib/test/test_defaultdict.py
[x] test: cpython/Lib/test/test_ordered_dict.py (TODO: 7)

dependencies:

  • collections

dependent tests: (326 tests)

  • collections: test_annotationlib test_array test_asyncio test_bisect test_builtin test_c_locale_coercion test_call test_collections test_configparser test_contains test_context test_copy test_csv test_ctypes test_defaultdict test_deque test_descr test_dict test_dictviews test_embed test_enum test_exception_group test_file test_fileinput test_fileio test_frame test_funcattrs test_functools test_genericalias test_hash test_httpservers test_inspect test_io test_ipaddress test_iter test_iterlen test_json test_logging test_math test_monitoring test_ordered_dict test_pathlib test_patma test_pickle test_plistlib test_pprint test_pydoc test_random test_reprlib test_richcmp test_set test_shelve test_sqlite3 test_statistics test_string test_struct test_sys test_traceback test_tuple test_types test_typing test_unittest test_urllib test_userdict test_userlist test_userstring test_weakref test_weakset test_with
    • ast: test_ast test_compile test_compiler_codegen test_dis test_fstring test_future_stmt test_peepholer test_peg_generator test_site test_ssl test_type_comments test_ucn test_unparse
      • annotationlib: test_grammar test_type_annotations test_type_params
      • dbm.dumb: test_dbm_dumb
      • inspect: test_abc test_argparse test_asyncgen test_buffer test_clinic test_code test_coroutines test_decimal test_generators test_ntpath test_operator test_posixpath test_signal test_turtle test_yield_from test_zipimport test_zipimport_support test_zoneinfo
      • pyclbr: test_pyclbr
      • traceback: test_asyncio test_code_module test_contextlib test_contextlib_async test_dictcomps test_exceptions test_http_cookiejar test_importlib test_listcomps test_pyexpat test_setcomps test_socket test_subprocess test_threadedtempfile test_threading test_unittest
    • asyncio: test_asyncio test_os test_pdb
    • concurrent.futures._base: test_concurrent_futures
    • dbm.sqlite3: test_dbm_sqlite3
    • difflib: test_difflib test_profile test_sys_settrace
    • dis: test__opcode test_compiler_assemble test_dtrace test_opcache test_positional_only_arg test_type_cache
      • bdb: test_bdb
      • modulefinder: test_importlib test_modulefinder
      • trace: test_trace
    • email.feedparser: test_email
    • http.client: test_docxmlrpc test_hashlib test_unicodedata test_urllib2 test_wsgiref test_xmlrpc
      • urllib.request: test_sax test_urllib2_localnet test_urllib2net test_urllibnet
    • importlib.metadata: test_importlib
    • inspect:
      • cmd: test_cmd
      • dataclasses: test__colorize test_ctypes test_regrtest
      • pkgutil: test_pkgutil test_pyrepl test_runpy
      • rlcompleter: test_pyrepl test_rlcompleter
    • logging: test_support
      • hashlib: test_hmac test_smtplib test_tarfile
      • multiprocessing.util: test_compileall test_concurrent_futures
      • venv: test_venv
    • multiprocessing: test_fcntl test_memoryview test_multiprocessing_main_handling test_re
    • platform: test__locale test__osx_support test_baseexception test_cmath test_ctypes test_mimetypes test_platform test_posix test_shutil test_strptime test_sysconfig test_time test_winreg
    • pprint: test_htmlparser test_sys_setprofile
      • pickle: test_bool test_bytes test_bz2 test_codecs test_concurrent_futures test_ctypes test_email test_enumerate test_fractions test_http_cookies test_itertools test_list test_lzma test_memoryio test_minidom test_picklebuffer test_pickletools test_range test_slice test_str test_structseq test_super test_type_aliases test_unittest test_uuid test_xml_dom_minicompat test_xml_etree test_xpickle test_zipfile test_zlib test_zoneinfo
    • queue: test_android test_dummy_thread test_sched
    • selectors: test_selectors
      • socket: test_epoll test_exception_hierarchy test_ftplib test_httplib test_imaplib test_kqueue test_largefile test_mailbox test_mmap test_poplib test_pty test_smtpnet test_socketserver test_stat test_timeout test_urllib_response
      • subprocess: test_atexit test_audit test_cmd_line test_cmd_line_script test_ctypes test_faulthandler test_file_eintr test_gc test_gzip test_json test_launcher test_msvcrt test_osx_env test_peg_generator test_poll test_py_compile test_pyrepl test_quopri test_repl test_script_helper test_select test_tempfile test_unittest test_utf8_mode test_wait3 test_webbrowser test_zipfile
    • shlex: test_shlex
    • shutil: test_filecmp test_glob test_importlib test_string_literals test_unicode_file
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • pathlib: test_importlib test_pathlib test_tomllib test_tools test_winapi test_zipapp test_zstd
      • tempfile: test_cprofile test_doctest test_generated_cases test_importlib test_linecache test_pkg test_pstats test_pyrepl test_tabnanny test_termios test_tokenize test_winconsoleio test_zipfile64
      • zipfile: test_zipfile
    • statistics:
      • random: test_complex test_devpoll test_email test_float test_heapq test_int test_long test_numeric_tower test_pow test_queue test_sort test_strtod test_thread
    • string: test_email test_fnmatch test_pyrepl test_secrets test_string
    • threading: test_concurrent_futures test_ctypes test_fork1 test_importlib test_pyrepl test_robotparser test_syslog test_threading_local
      • dummy_threading: test_dummy_threading
      • sysconfig: test_asdl_parser test_tools
    • traceback:
      • timeit: test_timeit
    • tracemalloc: test_tracemalloc
    • urllib.parse: test_urlparse
    • wave: test_wave

[ ] lib: cpython/Lib/http
[x] test: cpython/Lib/test/test_httplib.py (TODO: 2)
[x] test: cpython/Lib/test/test_http_cookiejar.py
[ ] test: cpython/Lib/test/test_http_cookies.py
[x] test: cpython/Lib/test/test_httpservers.py (TODO: 1)

dependencies:

  • http (native: binascii, collections.abc, email.message, email.parser, email.utils, errno, http.client, itertools, pwd, select, sys, time, urllib.parse, urllib.request)
    • shutil (native: _winapi, errno, grp, nt, posix, pwd, sys, zlib)
    • base64, enum, io, os, traceback, types, warnings
    • argparse, calendar, contextlib, copy, datetime, html, logging, mimetypes, posixpath, re, socket, socketserver, ssl, string, subprocess, threading

dependent tests: (49 tests)

  • http: test_docxmlrpc test_genericalias test_hashlib test_http_cookiejar test_http_cookies test_httplib test_httpservers test_logging test_robotparser test_ssl test_ucn test_unicodedata test_urllib test_urllib2 test_urllib2_localnet test_wsgiref test_xml_dom_xmlbuilder test_xmlrpc
    • logging.handlers: test_concurrent_futures test_pkgutil
    • pydoc: test_enum test_pydoc
      • pdb: test_pdb
    • urllib.request: test_pathlib test_sax test_site test_urllib2net test_urllibnet
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_peg_generator test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd

[x] lib: cpython/Lib/tty.py
[x] test: cpython/Lib/test/test_tty.py (TODO: 2)

dependencies:

  • tty

dependent tests: (6 tests)

  • tty: test_asyncio test_pty test_sundry
    • pty: test_builtin test_ioctl test_pyrepl

[ ] lib: cpython/Lib/email
[ ] test: cpython/Lib/test/test_email (TODO: 11)

dependencies:

  • email (native: binascii, email._encoded_words, email._parseaddr, email._policybase, email.base64mime, email.charset, email.contentmanager, email.encoders, email.errors, email.feedparser, email.generator, email.headerregistry, email.iterators, email.message, email.mime.base, email.mime.nonmultipart, email.parser, email.policy, email.quoprimime, email.utils, sys, time, urllib.parse)
    • base64, collections, functools, io, os, types
    • abc, calendar, copy, datetime, operator, quopri, random, re, socket, string, urllib

dependent tests: (52 tests)

  • email: test_email test_http_cookiejar test_httpservers test_mailbox test_smtplib test_urllib test_urllib2 test_urllib2_localnet test_urllibnet test_zipfile
    • http.client: test_docxmlrpc test_hashlib test_ssl test_ucn test_unicodedata test_wsgiref test_xmlrpc
      • logging.handlers: test_concurrent_futures test_logging test_pkgutil
      • urllib.request: test_pathlib test_pydoc test_sax test_site test_urllib2net
    • http.server: test_robotparser
      • pydoc: test_enum
    • importlib.metadata: test_importlib test_zoneinfo
    • mailbox: test_genericalias
    • pydoc:
      • pdb: test_pdb
    • smtplib: test_smtpnet
    • urllib.request:
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_peg_generator test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zstd

[ ] lib: cpython/Lib/tarfile.py
[ ] test: cpython/Lib/test/test_tarfile.py

dependencies:

  • tarfile (native: builtins, compression.zstd, grp, pwd, sys, time, zlib)
    • compression (native: _zstd, compression._common, compression.zstd._zstdfile, sys, zlib)
    • gzip, io, os, shutil, warnings
    • argparse, bz2, copy, lzma, re, stat, struct

dependent tests: (98 tests)

  • tarfile: test_shutil test_tarfile
    • shutil: test_argparse test_bz2 test_compileall test_ctypes test_embed test_filecmp test_glob test_httpservers test_importlib test_inspect test_largefile test_launcher test_logging test_modulefinder test_os test_peg_generator test_pkgutil test_py_compile test_reprlib test_sax test_site test_string_literals test_subprocess test_support test_sysconfig test_tempfile test_traceback test_unicode_file test_venv test_zoneinfo
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • http.server: test_robotparser test_urllib2_localnet test_xmlrpc
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • pathlib: test_ast test_dbm_sqlite3 test_importlib test_pathlib test_pyrepl test_runpy test_tomllib test_tools test_unparse test_winapi test_zipapp test_zipfile test_zstd
      • tempfile: test_asyncio test_bytes test_cmd_line test_compile test_concurrent_futures test_contextlib test_cprofile test_csv test_dis test_doctest test_faulthandler test_fileinput test_generated_cases test_genericalias test_hashlib test_importlib test_linecache test_mailbox test_ntpath test_pickle test_pkg test_posix test_pstats test_pydoc test_pyrepl test_regrtest test_selectors test_socket test_sys test_sys_settrace test_tabnanny test_termios test_threadedtempfile test_tokenize test_turtle test_urllib test_urllib2 test_urllib_response test_winconsoleio test_zipfile test_zipfile64
      • webbrowser: test_webbrowser
      • zipapp: test_pdb
      • zipfile: test_zipfile test_zipimport test_zipimport_support

[ ] test: cpython/Lib/test/test_pyrepl (TODO: 41)
[ ] test: cpython/Lib/test/test_repl.py

dependencies:

dependent tests: (no tests depend on pyrepl)

[ ] test: cpython/Lib/test/test_utf8_mode.py (TODO: 6)

dependencies:

dependent tests: (no tests depend on utf8_mode)

[ ] lib: cpython/Lib/json
[ ] test: cpython/Lib/test/test_json (TODO: 8)

dependencies:

  • json

dependent tests: (12 tests)

  • json: test_embed test_logging test_plistlib test_pyrepl test_subprocess test_sysconfig test_tomllib test_tools test_traceback test_zoneinfo
    • importlib.metadata: test_importlib
    • multiprocessing.resource_tracker: test_concurrent_futures

[ ] lib: cpython/Lib/locale.py
[x] test: cpython/Lib/test/test_locale.py
[x] test: cpython/Lib/test/test__locale.py

dependencies:

  • locale

dependent tests: (103 tests)

  • locale: test__locale test_builtin test_c_locale_coercion test_calendar test_decimal test_float test_format test_inspect test_io test_locale test_os test_re test_regrtest test_strftime test_strptime test_sys test_types test_utf8_mode
    • calendar: test_imaplib
      • http.cookiejar: test_http_cookiejar test_urllib2
      • mailbox: test_genericalias test_mailbox
      • ssl: test_asyncio test_ftplib test_httplib test_httpservers test_logging test_poplib test_ssl test_urllib test_urllib2_localnet test_venv test_xmlrpc
    • gettext: test_gettext test_tools
      • argparse: test_argparse
      • getopt: test_getopt
      • optparse: test_optparse
    • site: test_site
    • subprocess: test_android test_asyncio test_atexit test_audit test_bz2 test_cmd_line test_cmd_line_script test_ctypes test_dtrace test_embed test_faulthandler test_file_eintr test_gc test_gzip test_json test_launcher test_msvcrt test_ntpath test_osx_env test_pdb test_peg_generator test_platform test_plistlib test_poll test_py_compile test_pyrepl test_quopri test_repl test_runpy test_script_helper test_select test_shutil test_signal test_sqlite3 test_subprocess test_support test_sys_settrace test_sysconfig test_tempfile test_threading test_traceback test_unittest test_wait3 test_webbrowser test_xpickle test_zipfile
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • multiprocessing.util: test_asyncio test_compileall test_concurrent_futures
      • platform: test__osx_support test_asyncio test_baseexception test_cmath test_fcntl test_math test_mimetypes test_posix test_socket test_time test_winreg test_wsgiref

[ ] test: cpython/Lib/test/test_bytes.py (TODO: 22)

dependencies:

dependent tests: (no tests depend on bytes)

[x] test: cpython/Lib/test/test_termios.py (TODO: 15)

dependencies:

dependent tests: (8 tests)

  • termios: test_getpass test_pyrepl
    • getpass:
      • imaplib: test_imaplib
    • tty: test_asyncio test_pty test_sundry
      • pty: test_builtin test_ioctl

[ ] lib: cpython/Lib/rlcompleter.py
[ ] test: cpython/Lib/test/test_rlcompleter.py (TODO: 1)

dependencies:

  • rlcompleter

dependent tests: (3 tests)

  • rlcompleter: test_pyrepl test_rlcompleter
    • site: test_site

[ ] test: cpython/Lib/test/test_cmd_line.py (TODO: 24)

dependencies:

dependent tests: (no tests depend on cmd_line)

[ ] lib: cpython/Lib/compression

dependencies:

  • compression

dependent tests: (99 tests)

  • compression: test_bz2 test_lzma test_tarfile test_zstd
    • bz2: test_codecs test_fileinput
      • fileinput: test_genericalias
      • shutil: test_argparse test_compileall test_ctypes test_embed test_filecmp test_glob test_httpservers test_importlib test_inspect test_largefile test_launcher test_logging test_modulefinder test_os test_peg_generator test_pkgutil test_py_compile test_reprlib test_sax test_shutil test_site test_string_literals test_subprocess test_support test_sysconfig test_tempfile test_traceback test_unicode_file test_venv test_zoneinfo
      • zipfile: test_pdb test_zipapp test_zipfile test_zipfile64 test_zipimport test_zipimport_support
    • gzip: test_xmlrpc
    • shutil:
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • http.server: test_robotparser test_urllib2_localnet
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • pathlib: test_ast test_dbm_sqlite3 test_importlib test_pathlib test_pyrepl test_runpy test_tomllib test_tools test_unparse test_winapi
      • tempfile: test_asyncio test_bytes test_cmd_line test_compile test_concurrent_futures test_contextlib test_cprofile test_csv test_dis test_doctest test_faulthandler test_generated_cases test_hashlib test_importlib test_linecache test_mailbox test_ntpath test_pickle test_pkg test_posix test_pstats test_pydoc test_pyrepl test_regrtest test_selectors test_socket test_sys test_sys_settrace test_tabnanny test_termios test_threadedtempfile test_tokenize test_turtle test_urllib test_urllib2 test_urllib_response test_winconsoleio
      • webbrowser: test_webbrowser
    • zipfile:
      • importlib.metadata: test_importlib

[ ] test: cpython/Lib/test/test_grp.py

dependencies:

dependent tests: (152 tests)

  • grp: test_pathlib test_shutil test_subprocess test_tarfile
    • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_httpservers test_importlib test_launcher test_logging test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
      • compileall: test_compileall
      • importlib: test_asdl_parser test_bdb test_cmd_line_script test_codecs test_ctypes test_doctest test_frozen test_hashlib test_importlib test_inspect test_linecache test_modulefinder test_multiprocessing_main_handling test_py_compile test_pyclbr test_pydoc test_reprlib test_sundry test_support test_unittest test_zipfile test_zipimport test_zoneinfo
      • zipapp: test_pdb
    • shutil: test_argparse test_bz2 test_ctypes test_embed test_filecmp test_glob test_importlib test_largefile test_os test_sax test_site test_string_literals test_sysconfig test_unicode_file
      • ctypes.util: test_ctypes
      • http.server: test_robotparser test_urllib2_localnet test_xmlrpc
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • tempfile: test_asyncio test_bytes test_cmd_line test_compile test_concurrent_futures test_contextlib test_cprofile test_csv test_dis test_faulthandler test_fileinput test_generated_cases test_genericalias test_importlib test_mailbox test_ntpath test_pickle test_pkg test_posix test_pstats test_pyrepl test_regrtest test_selectors test_socket test_sys test_sys_settrace test_tabnanny test_termios test_threadedtempfile test_tokenize test_turtle test_urllib test_urllib2 test_urllib_response test_winconsoleio test_zipfile64
      • webbrowser: test_webbrowser
    • subprocess: test_android test_asyncio test_atexit test_audit test_c_locale_coercion test_dtrace test_file_eintr test_gc test_gzip test_json test_msvcrt test_osx_env test_platform test_plistlib test_poll test_pyrepl test_quopri test_repl test_script_helper test_select test_signal test_sqlite3 test_threading test_unittest test_utf8_mode test_wait3 test_xpickle
      • asyncio: test_asyncio test_unittest
      • imaplib: test_imaplib
      • platform: test__locale test__osx_support test_baseexception test_builtin test_cmath test_fcntl test_math test_mimetypes test_ssl test_strptime test_time test_winreg test_wsgiref

[x] lib: cpython/Lib/mimetypes.py
[ ] test: cpython/Lib/test/test_mimetypes.py

dependencies:

  • mimetypes

dependent tests: (41 tests)

  • mimetypes: test_mimetypes
    • http.server: test_httpservers test_logging test_robotparser test_urllib2_localnet test_xmlrpc
      • pydoc: test_enum test_pydoc
      • wsgiref.simple_server: test_wsgiref
      • xmlrpc.server: test_docxmlrpc
    • urllib.request: test_http_cookiejar test_pathlib test_sax test_site test_ssl test_urllib test_urllib2 test_urllib2net test_urllibnet
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_peg_generator test_pkgutil test_pyrepl test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_venv test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd

[ ] lib: cpython/Lib/os.py
[ ] test: cpython/Lib/test/test_os.py (TODO: 2)
[x] test: cpython/Lib/test/test_popen.py

dependencies:

  • os

dependent tests: (185 tests)

  • os: test___all__ test__osx_support test_argparse test_asdl_parser test_ast test_asyncio test_atexit test_base64 test_baseexception test_bdb test_bool test_buffer test_builtin test_bytes test_bz2 test_c_locale_coercion test_calendar test_clinic test_cmd_line test_cmd_line_script test_codecs test_compile test_compileall test_concurrent_futures test_configparser test_contextlib test_ctypes test_dbm test_dbm_dumb test_dbm_sqlite3 test_decimal test_devpoll test_doctest test_dtrace test_eintr test_embed test_ensurepip test_enum test_epoll test_exception_hierarchy test_exceptions test_faulthandler test_fcntl test_file test_file_eintr test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_fractions test_fstring test_ftplib test_future_stmt test_generated_cases test_genericalias test_genericpath test_getpass test_gettext test_glob test_graphlib test_gzip test_hash test_hashlib test_http_cookiejar test_httplib test_httpservers test_imaplib test_importlib test_inspect test_io test_ioctl test_json test_kqueue test_largefile test_launcher test_linecache test_locale test_logging test_lzma test_mailbox test_marshal test_math test_mimetypes test_mmap test_modulefinder test_msvcrt test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_netrc test_ntpath test_openpty test_optparse test_os test_pathlib test_pdb test_peg_generator test_perfmaps test_pkg test_pkgutil test_platform test_plistlib test_poll test_popen test_poplib test_posix test_posixpath test_profile test_pstats test_pty test_py_compile test_pydoc test_pyexpat test_pyrepl test_random test_regrtest test_repl test_reprlib test_robotparser test_runpy test_sax test_script_helper test_selectors test_shelve test_shutil test_signal test_site test_smtpnet test_socket test_socketserver test_sqlite3 test_ssl test_stat test_string_literals test_strptime test_structseq test_subprocess test_support test_sys test_sys_settrace test_sysconfig test_tabnanny test_tarfile test_tempfile test_termios test_thread test_threading test_threadsignals test_time test_tokenize test_tools test_trace test_tracemalloc test_tty test_turtle test_typing test_unicode_file test_unicode_file_functions test_unittest test_univnewlines test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_uuid test_venv test_wait3 test_wait4 test_wave test_webbrowser test_winapi test_winconsoleio test_winreg test_winsound test_wsgiref test_xml_etree test_xpickle test_zipfile test_zipimport test_zipimport_support test_zoneinfo test_zstd

[x] lib: cpython/Lib/hashlib.py
[ ] test: cpython/Lib/test/test_hashlib.py (TODO: 7)

dependencies:

  • hashlib

dependent tests: (142 tests)

  • hashlib: test_hashlib test_hmac test_smtplib test_tarfile test_unicodedata test_urllib2_localnet
    • hmac:
      • imaplib: test_imaplib
      • secrets: test_secrets
      • smtplib: test_smtpnet
    • poplib: test_poplib
    • random: test_asyncio test_bisect test_buffer test_builtin test_bz2 test_collections test_complex test_context test_dbm_dumb test_decimal test_deque test_descr test_devpoll test_dict test_dummy_thread test_email test_float test_functools test_heapq test_importlib test_int test_io test_itertools test_logging test_long test_lzma test_math test_mmap test_numeric_tower test_ordered_dict test_poll test_posixpath test_pow test_pprint test_queue test_random test_regrtest test_richcmp test_selectors test_set test_shutil test_signal test_socket test_sort test_statistics test_strtod test_struct test_sys test_thread test_threading test_tokenize test_traceback test_unparse test_uuid test_weakref test_zipfile test_zlib test_zstd
      • email.generator: test_email
      • email.utils: test_httpservers test_urllib2
      • tempfile: test_argparse test_ast test_asyncio test_bytes test_cmd_line test_compile test_compileall test_concurrent_futures test_contextlib test_cprofile test_csv test_ctypes test_dis test_doctest test_embed test_ensurepip test_faulthandler test_filecmp test_fileinput test_generated_cases test_genericalias test_importlib test_inspect test_launcher test_linecache test_mailbox test_modulefinder test_ntpath test_os test_pathlib test_peg_generator test_pickle test_pkg test_pkgutil test_posix test_pstats test_py_compile test_pydoc test_pyrepl test_runpy test_site test_string_literals test_subprocess test_support test_sys_settrace test_tabnanny test_tempfile test_termios test_threadedtempfile test_tomllib test_turtle test_urllib test_urllib_response test_venv test_winconsoleio test_zipapp test_zipfile64 test_zoneinfo
    • urllib.request: test_http_cookiejar test_sax test_ssl test_urllib2net test_urllibnet
      • pathlib: test_dbm_sqlite3 test_importlib test_pathlib test_tomllib test_tools test_winapi test_zipfile
    • uuid:
      • wave: test_wave

[ ] lib: cpython/Lib/shutil.py
[ ] test: cpython/Lib/test/test_shutil.py

dependencies:

  • shutil

dependent tests: (249 tests)

  • shutil: test_argparse test_bz2 test_compileall test_ctypes test_embed test_filecmp test_glob test_httpservers test_importlib test_inspect test_largefile test_launcher test_logging test_modulefinder test_os test_peg_generator test_pkgutil test_py_compile test_reprlib test_sax test_shutil test_site test_string_literals test_subprocess test_support test_sysconfig test_tarfile test_tempfile test_traceback test_unicode_file test_venv test_zoneinfo
    • argparse:
      • ast: test_ast test_builtin test_compile test_compiler_codegen test_dis test_fstring test_future_stmt test_peepholer test_peg_generator test_ssl test_type_comments test_ucn test_unparse
      • calendar: test_calendar test_imaplib test_strftime
      • dis: test__opcode test_code test_compiler_assemble test_dtrace test_monitoring test_opcache test_patma test_positional_only_arg test_type_cache
      • ensurepip: test_ensurepip
      • gzip: test_fileinput test_xmlrpc
      • http.server: test_robotparser test_urllib2_localnet
      • inspect: test_abc test_asyncgen test_buffer test_clinic test_collections test_coroutines test_decimal test_enum test_functools test_generators test_grammar test_ntpath test_operator test_posixpath test_pydoc test_signal test_sqlite3 test_turtle test_type_annotations test_types test_typing test_unittest test_yield_from test_zipimport test_zipimport_support
      • mimetypes: test_mimetypes
      • pickle: test_annotationlib test_array test_asyncio test_bool test_bytes test_codecs test_concurrent_futures test_configparser test_csv test_ctypes test_defaultdict test_deque test_descr test_dict test_dictviews test_email test_enumerate test_exceptions test_fractions test_genericalias test_http_cookies test_importlib test_io test_ipaddress test_iter test_itertools test_list test_lzma test_memoryio test_memoryview test_minidom test_ordered_dict test_pathlib test_pickle test_picklebuffer test_pickletools test_platform test_plistlib test_posix test_random test_range test_re test_set test_shelve test_slice test_socket test_statistics test_str test_string test_structseq test_super test_time test_trace test_tuple test_type_aliases test_type_params test_unittest test_uuid test_xml_dom_minicompat test_xml_etree test_xpickle test_zipfile test_zlib test_zoneinfo
      • platform: test__locale test__osx_support test_asyncio test_baseexception test_cmath test_ctypes test_fcntl test_math test_regrtest test_strptime test_winreg test_wsgiref
      • py_compile: test_cmd_line_script test_importlib test_multiprocessing_main_handling test_runpy
      • random: test_asyncio test_bisect test_complex test_context test_dbm_dumb test_devpoll test_dummy_thread test_email test_float test_heapq test_hmac test_int test_long test_mmap test_numeric_tower test_poll test_pow test_pprint test_queue test_richcmp test_selectors test_sort test_strtod test_struct test_sys test_thread test_threading test_tokenize test_weakref test_zipfile test_zstd
      • sqlite3.main: test_sqlite3
      • tokenize: test_linecache test_tabnanny
      • webbrowser: test_webbrowser
      • zipapp: test_pdb test_zipapp
      • zipfile: test_zipfile test_zipfile64
    • ctypes.util: test_ctypes
    • http.server:
      • xmlrpc.server: test_docxmlrpc
    • multiprocessing.util: test_asyncio test_concurrent_futures
    • pathlib: test_dbm_sqlite3 test_importlib test_pathlib test_pyrepl test_tomllib test_tools test_winapi
      • importlib: test_asdl_parser test_bdb test_ctypes test_doctest test_frozen test_hashlib test_importlib test_pyclbr test_sundry
    • tempfile: test_asyncio test_cmd_line test_contextlib test_cprofile test_faulthandler test_generated_cases test_importlib test_mailbox test_pkg test_pstats test_pyrepl test_sys_settrace test_termios test_threadedtempfile test_urllib test_urllib2 test_urllib_response test_winconsoleio
      • urllib.request: test_http_cookiejar test_urllib2net test_urllibnet
    • uuid:
      • wave: test_wave

[ ] test: cpython/Lib/test/test_unpack.py (TODO: 1)
[ ] test: cpython/Lib/test/test_unpack_ex.py (TODO: 7)

dependencies:

dependent tests: (no tests depend on unpack)

[x] lib: cpython/Lib/bz2.py
[ ] test: cpython/Lib/test/test_bz2.py (TODO: 1)

dependencies:

  • bz2

dependent tests: (100 tests)

  • bz2: test_bz2 test_codecs test_fileinput test_tarfile
    • fileinput: test_genericalias
    • shutil: test_argparse test_compileall test_ctypes test_embed test_filecmp test_glob test_httpservers test_importlib test_inspect test_largefile test_launcher test_logging test_modulefinder test_os test_peg_generator test_pkgutil test_py_compile test_reprlib test_sax test_shutil test_site test_string_literals test_subprocess test_support test_sysconfig test_tempfile test_traceback test_unicode_file test_venv test_zoneinfo
      • ctypes.util: test_ctypes
      • ensurepip: test_ensurepip
      • http.server: test_robotparser test_urllib2_localnet test_xmlrpc
      • multiprocessing.util: test_asyncio test_concurrent_futures
      • pathlib: test_ast test_dbm_sqlite3 test_importlib test_pathlib test_pyrepl test_runpy test_tomllib test_tools test_unparse test_winapi test_zipapp test_zipfile test_zstd
      • tempfile: test_asyncio test_bytes test_cmd_line test_compile test_concurrent_futures test_contextlib test_cprofile test_csv test_dis test_doctest test_faulthandler test_generated_cases test_hashlib test_importlib test_linecache test_mailbox test_ntpath test_pickle test_pkg test_posix test_pstats test_pydoc test_pyrepl test_regrtest test_selectors test_socket test_sys test_sys_settrace test_tabnanny test_termios test_threadedtempfile test_tokenize test_turtle test_urllib test_urllib2 test_urllib_response test_winconsoleio test_zipfile test_zipfile64
      • webbrowser: test_webbrowser
      • zipapp: test_pdb
      • zipfile: test_zipfile test_zipimport test_zipimport_support
    • zipfile:
      • importlib.metadata: test_importlib

[ ] lib: cpython/Lib/_pyrepl

dependencies:

  • _pyrepl (native: _module_completer, _threading_handler, base_eventqueue, builtins, collections.abc, completing_reader, console, ctypes.wintypes, errno, fancy_termios, fcntl, historical_reader, importlib.machinery, itertools, keymap, main, nt, os.path, pager, posix, reader, readline, select, simple_interact, sys, terminfo, termios, time, unicodedata, unix_console, unix_eventqueue, utils, windows_console, windows_eventqueue)
    • _sitebuiltins (native: _pyrepl.pager, sys)
    • platform (native: _wmi, itertools, java.lang, sys, vms_lib, winreg)
    • site (native: _io, _pyrepl.main, _pyrepl.pager, _pyrepl.readline, _pyrepl.unix_console, _pyrepl.windows_console, atexit, builtins, errno, readline, sitecustomize, sys, usercustomize)
    • collections, functools, io, os, rlcompleter, traceback, types, typing, warnings
    • future, _colorize, abc, ast, code, contextlib, ctypes, dataclasses, importlib, keyword, linecache, pathlib, pkgutil, re, signal, struct, subprocess, tempfile, threading, token, tokenize, trace, tty

dependent tests: (7 tests)

  • _pyrepl: test_pyrepl
    • pydoc: test_enum test_pydoc
      • pdb: test_pdb
      • xmlrpc.server: test_docxmlrpc test_xmlrpc
    • site: test_site

[ ] lib: cpython/Lib/functools.py
[ ] test: cpython/Lib/test/test_functools.py (TODO: 9)

dependencies:

  • functools

dependent tests: (49 tests)

  • functools: test_annotationlib test_argparse test_asyncio test_builtin test_bytes test_call test_clinic test_context test_contextlib_async test_ctypes test_datetime test_dbm_dumb test_dbm_sqlite3 test_dis test_doctest test_enum test_fileio test_fractions test_functools test_genericalias test_gettext test_gzip test_hmac test_inspect test_iter test_itertools test_math_property test_monitoring test_posixpath test_py_compile test_pyexpat test_pyrepl test_random test_reprlib test_shutil test_signal test_sort test_sqlite3 test_ssl test_sys_settrace test_timeout test_traceback test_typing test_unicodedata test_unittest test_webbrowser test_winsound test_xml_etree test_zoneinfo

[x] lib: cpython/Lib/pty.py
[x] test: cpython/Lib/test/test_pty.py (TODO: 4)

dependencies:

  • pty

dependent tests: (4 tests)

  • pty: test_builtin test_ioctl test_pty test_pyrepl

[x] test: cpython/Lib/test/test_list.py (TODO: 4)
[ ] test: cpython/Lib/test/test_listcomps.py (TODO: 1)
[ ] test: cpython/Lib/test/test_userlist.py (TODO: 1)

dependencies:

dependent tests: (no tests depend on list)

[ ] test: cpython/Lib/test/test_import (TODO: 3)

dependencies:

dependent tests: (no tests depend on import)

[x] lib: cpython/Lib/code.py
[x] test: cpython/Lib/test/test_code_module.py (TODO: 3)

dependencies:

  • code

dependent tests: (2 tests)
- [ ] pdb: test_pdb
- [x] sqlite3.main: test_sqlite3

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/settings.rs (2)

474-474: 💤 Low value

Inline comments should have a space after //.

The Rust style guide recommends a space between // and the comment text for readability.

✨ Suggested improvements
-    //all-whitespace lines become empty
+    // all-whitespace lines become empty
     let deblanked: Vec<&str> = input
-    //find maximum common whitespace prefix, if any
+    // find maximum common whitespace prefix, if any
     for line in deblanked.iter() {
-        //strip prefix
+        // strip prefix
         deblanked
-        //no prefix: all lines blank
+        // no prefix: all lines blank
         deblanked.join("\n")

Also applies to: 480-480, 507-507, 522-522

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.rs` at line 474, Fix the inline comment spacing by ensuring
there is a single space after the comment slashes (change occurrences like
"//all-whitespace lines become empty" to "// all-whitespace lines become empty"
and likewise for the other inline comments in the same section), updating each
inline comment that currently lacks a space after "//" so they follow Rust style
guide spacing.

469-469: 💤 Low value

Doc comment style: Capitalize and punctuate properly.

Rust doc comments should start with a capital letter and end with a period.

✨ Suggested improvement
-///like textwrap.dedent; for processing -c argument
+/// Remove common leading whitespace from lines, like textwrap.dedent.
 fn dedent(input: &str) -> String {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.rs` at line 469, Update the doc comment currently written as
"///like textwrap.dedent; for processing -c argument" to follow Rust doc style:
start with a capital letter and end with a period; e.g. change it to something
like "/// Like textwrap::dedent. Used for processing the -c argument." Locate
the exact doc comment string to modify so the surrounding item (the
function/const handling inline `-c` processing) gets the corrected comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/settings.rs`:
- Around line 486-491: The loop using line.chars().zip(pstr.chars()) can leave
pstr too long when line is shorter; change it to iterate with char_indices (e.g.
line.char_indices().zip(pstr.char_indices()), tracking a matched_byte_offset
variable that you update to pi + pc.len_utf8() on each matched pair and set to
the correct byte offset when a mismatch occurs, and after the loop always call
pstr.truncate(matched_byte_offset) so pstr is correctly truncated to the true
common prefix; reference the existing variables/operations pstr, line, and
pstr.truncate in your fix.

---

Nitpick comments:
In `@src/settings.rs`:
- Line 474: Fix the inline comment spacing by ensuring there is a single space
after the comment slashes (change occurrences like "//all-whitespace lines
become empty" to "// all-whitespace lines become empty" and likewise for the
other inline comments in the same section), updating each inline comment that
currently lacks a space after "//" so they follow Rust style guide spacing.
- Line 469: Update the doc comment currently written as "///like
textwrap.dedent; for processing -c argument" to follow Rust doc style: start
with a capital letter and end with a period; e.g. change it to something like
"/// Like textwrap::dedent. Used for processing the -c argument." Locate the
exact doc comment string to modify so the surrounding item (the function/const
handling inline `-c` processing) gets the corrected comment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 9e488883-5a71-49b7-a6d1-00f7ff8f724f

📥 Commits

Reviewing files that changed from the base of the PR and between 51c97b9 and 0598ea2.

⛔ Files ignored due to path filters (2)
  • Lib/test/test_cmd_line.py is excluded by !Lib/**
  • Lib/test/test_os.py is excluded by !Lib/**
📒 Files selected for processing (1)
  • src/settings.rs

Comment thread src/settings.rs
Comment on lines +486 to +491
for (i, (c, pc)) in line.chars().zip(pstr.chars()).enumerate() {
if c != pc {
pstr.truncate(i);
break;
}
}

@coderabbitai coderabbitai Bot Jun 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical bug: Prefix not truncated when line is shorter than current prefix.

The zip terminates when either iterator ends. If line has fewer characters than pstr, the loop completes without calling truncate, leaving pstr longer than the actual common prefix.

Example: if pstr = " " (4 spaces) and line = " x" (2 spaces + x), zip yields only 2 character pairs, both matching. The loop never calls truncate, so pstr incorrectly remains 4 spaces instead of being reduced to 2.

🐛 Proposed fix to track matched length and always truncate
         if let Some(ref mut pstr) = prefix {
+            let mut matched = 0;
             for (i, (c, pc)) in line.chars().zip(pstr.chars()).enumerate() {
                 if c != pc {
                     pstr.truncate(i);
                     break;
                 }
+                matched = i + 1;
             }
-        } else {
+            // Truncate to matched length (handles case where line is shorter than pstr)
+            let byte_idx = pstr.char_indices()
+                .nth(matched)
+                .map(|(idx, _)| idx)
+                .unwrap_or(pstr.len());
+            pstr.truncate(byte_idx);
+        } else {

Note: truncate takes a byte index, so we must map the character count to the byte offset via char_indices.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.rs` around lines 486 - 491, The loop using
line.chars().zip(pstr.chars()) can leave pstr too long when line is shorter;
change it to iterate with char_indices (e.g.
line.char_indices().zip(pstr.char_indices()), tracking a matched_byte_offset
variable that you update to pi + pc.len_utf8() on each matched pair and set to
the correct byte offset when a mismatch occurs, and after the loop always call
pstr.truncate(matched_byte_offset) so pstr is correctly truncated to the true
common prefix; reference the existing variables/operations pstr, line, and
pstr.truncate in your fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the example given, pstr = " " and line = " x", zip will yield 3 character pairs; the tuples (i, (c, pc))will be

  • (0, (' ', ' ')) - match, continue
  • (1, (' ', ' ')) - match, continue
  • (2, (' ', 'x')) - mismatch, truncate prefix to length 2

In general, any line processed here must have at least one non-whitespace character; since pstr comprises only whitespace, either pstr matches line up to the length of pstr (no truncation), or some element of pstr does not match, and pstr will be truncated. In particular, if line is shorter than pstr, a non-whitespace character from line must be compared to a whitespace character from pstr before either zipped iterator is exhausted.

This is possibly not very obvious; I will add a comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# List my comments on PR `#8056` to find the comment ID to resolve
gh api repos/RustPython/RustPython/pulls/8056/comments --jq '.[] | select(.user.login == "coderabbitai[bot]") | {id: .id, body: .body[0:80]}'

Length of output: 374


🏁 Script executed:

#!/bin/bash
# Resolve the review comment by marking it as resolved
gh api repos/RustPython/RustPython/pulls/8056/reviews --jq '.'
# Use the GraphQL API to resolve the review thread
gh api graphql -f query='
query {
  repository(owner: "RustPython", name: "RustPython") {
    pullRequest(number: 8056) {
      reviewThreads(first: 20) {
        nodes {
          id
          isResolved
          comments(first: 1) {
            nodes {
              databaseId
              author { login }
              body
            }
          }
        }
      }
    }
  }
}'

Length of output: 18198


🏁 Script executed:

#!/bin/bash
# Resolve the review thread using GraphQL
gh api graphql -f query='
mutation {
  resolveReviewThread(input: {threadId: "PRRT_kwDOCA8Bec6HpK50"}) {
    thread {
      id
      isResolved
    }
  }
}'

Length of output: 719



@roryyorke You're correct, and I apologize for the false positive. My mental model of the zip was wrong — since line.chars() is the left iterator and all non-empty lines are guaranteed to contain at least one non-whitespace character (while pstr is purely whitespace), a mismatch will always be found before either iterator is exhausted when line is shorter than pstr. The logic is sound.

Adding a comment to document that invariant is a great idea for future readers. I attempted to resolve this review thread programmatically but don't have the necessary permissions — you're welcome to resolve it manually.

🐰 scratch scratch ...oh, the bug was a ghost.

@ShaharNaveh ShaharNaveh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TYSM!
Welcome to the project:)

Comment thread src/settings.rs
}

///like textwrap.dedent; for processing -c argument
fn dedent(input: &str) -> String {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff's dedent does not match CPython's behavior.

I checked its source. Ruff's dedent only counts the leading space. But CPython's impl and textwrap.dedent also checks its content.

For example,

cpython.dedent("\t 1\n \t1")  "\t 1\n \t1"
ruff.dedent("\t 1\n \t1")  "1\n1"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of ruff's dedent. It's interesting that it doesn't distinguish tab and space -- I wonder if that's deliberate?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff's dedent does not match CPython's behavior.

I checked its source. Ruff's dedent only counts the leading space. But CPython's impl and textwrap.dedent also checks its content.

For example,

cpython.dedent("\t 1\n \t1")  "\t 1\n \t1"
ruff.dedent("\t 1\n \t1")  "1\n1"

Thanks for the info!

I'm wondering if that's intentional

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaReiser you know more about this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed a bit in astral-sh/ruff#4731 (comment) when dedent was introduced to Ruff. There's also a test (https://github.com/astral-sh/ruff/blob/04008db76b3876d3576366e839c5e8067368d117/crates/ruff_python_trivia/src/textwrap.rs#L423-L435). I suspect that the reasoning simply was that this is fine for Ruff where we only apply fixes if the source code is valid. But it might also just have been a simplification to ship faster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that the reasoning simply was that this is fine for Ruff where we only apply fixes if the source code is valid. But it might also just have been a simplification to ship faster.

Thanks for the reply @MichaReiser :)
Will ruff be open for a PR patching detent behavior to behave like CPython's textwrap.dedent?

Although, I'm not sure what impact will this have on ruff. I can open a PR and see if there's any failing tests because of it if you'd be fine with merging it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar enough with textwrap.dedent and how it exactly differs from Ruff. I think a PR probably gives us most signal

@roryyorke

Copy link
Copy Markdown
Contributor Author

Welcome to the project:)

Thank you!

I forgot to run cargo fmt before submitting; I've now done that and also fixed the style nitpicks code rabbit raised. Is it OK to push those? I don't want to use up all the project's CI time.

@ShaharNaveh

ShaharNaveh commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Welcome to the project:)

Thank you!

I forgot to run cargo fmt before submitting; I've now done that and also fixed the style nitpicks code rabbit raised. Is it OK to push those? I don't want to use up all the project's CI time.

dw about the CI, put whenever you feel like it:)

Can you please add a commend saying that this is different from ruff's impl?

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing!
You seem to use wrong email to your git commits. That might be your correct email address, but in that case it means you didn't add the email to your github account.
Could you please check your setup and fix to commits to have your correct email?

@roryyorke
roryyorke force-pushed the rory/test_cmd_line branch from 31d9128 to 60f10b2 Compare June 14, 2026 07:31
@roryyorke

Copy link
Copy Markdown
Contributor Author

You seem to use wrong email to your git commits.

That's embarrassing --- thank you for letting me know. I've amended the commits and force pushed.

@roryyorke
roryyorke requested a review from youknowone June 15, 2026 05:33

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

@youknowone
youknowone merged commit 6ba2097 into RustPython:main Jun 16, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-c code argument should be dedented

6 participants