Skip to content

Update test_tempfile.py to 3.14.6#8165

Open
ShaharNaveh wants to merge 1 commit into
RustPython:mainfrom
ShaharNaveh:update-test-tempfile
Open

Update test_tempfile.py to 3.14.6#8165
ShaharNaveh wants to merge 1 commit into
RustPython:mainfrom
ShaharNaveh:update-test-tempfile

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows permission handling in temporary-directory tests by using a locale-independent account identifier, making the test more reliable across language settings.
  • Tests
    • Updated an expected-failure platform list formatting in test coverage without changing behavior.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

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

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

dependencies:

  • tempfile

dependent tests: (93 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
    • pdb: test_pdb
    • urllib.request: test_http_cookiejar test_sax test_ssl test_urllib2_localnet test_urllib2net test_urllibnet
      • pathlib: test_dbm_sqlite3 test_importlib test_json test_pathlib test_tarfile test_tomllib test_tools test_unparse test_winapi test_zipfile

Legend:

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

@coderabbitai

coderabbitai Bot commented Jun 25, 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: a08b6eaa-0cb9-456c-8925-2939028ef45e

📥 Commits

Reviewing files that changed from the base of the PR and between 870ad2d and 5adb902.

📒 Files selected for processing (1)
  • Lib/test/test_tempfile.py

📝 Walkthrough

Walkthrough

Updated tempfile tests to use a locale-independent Windows ACL SID when toggling read-only directory permissions, and changed one expected-failure platform tuple to single-quoted syntax.

Changes

Tempfile test portability tweaks

Layer / File(s) Summary
Windows ACL commands
Lib/test/test_tempfile.py
test_read_only_directory now uses *S-1-1-0 for the deny and restore icacls commands, with comments noting the locale-independent principal.
Expected-failure tuple formatting
Lib/test/test_tempfile.py
TestTemporaryDirectory keeps the same platform set in @unittest.expectedFailureIf using single-quoted tuple syntax.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

I hopped through tests with a twitch of my nose,
Swapped in a SID where the locale winds blow.
My tempfile burrow stays tidy and bright,
And Android/Linux still hop just right. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR objective and clearly identifies the file being updated.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

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.

1 participant