Skip to content

Update socket.py to 3.14.5#7866

Merged
youknowone merged 3 commits into
RustPython:mainfrom
ShaharNaveh:update-socket
May 13, 2026
Merged

Update socket.py to 3.14.5#7866
youknowone merged 3 commits into
RustPython:mainfrom
ShaharNaveh:update-socket

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Fixed platform compatibility by restricting hostname resolution functionality to supported platforms.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

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: ab8914d6-4139-4e43-9e1d-04997d88ed8b

📥 Commits

Reviewing files that changed from the base of the PR and between 7ebffd0 and 42712f2.

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

📝 Walkthrough

Walkthrough

The gethostname function's Unix platform gate is refined to exclude Android alongside Redox by adding target_os = "android" to the conditional compilation check, preventing this function from being built for Android targets.

Changes

Platform Gate Exclusion for gethostname

Layer / File(s) Summary
Platform gate update for gethostname
crates/stdlib/src/socket.rs
The #[cfg(...)] attribute for the gethostname function is refined to exclude Android targets in addition to the existing Redox exclusion.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • youknowone

Poem

🐰 A rabbit hops through Unix streams so bright,
But Android's path diverges from its sight,
Redox already out, now paired with care,
The hostname function finds its proper lair!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims to update socket.py to 3.14.5, but the actual change is a conditional compilation update for the gethostname function to exclude Android, which is unrelated to a version update. Update the title to accurately reflect the change, such as 'Exclude Android from gethostname conditional compilation' or 'Fix gethostname to skip Android platform'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 and usage tips.

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

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

[x] lib: cpython/Lib/socket.py
[ ] test: cpython/Lib/test/test_socket.py (TODO: 17)

dependencies:

  • socket

dependent tests: (97 tests)

  • socket: test_asyncio test_epoll test_exception_hierarchy test_ftplib test_httplib test_httpservers test_imaplib test_kqueue test_largefile test_logging test_mailbox test_mmap test_os test_pathlib test_poplib test_pty test_selectors test_signal test_smtplib test_smtpnet test_socket test_socketserver test_ssl test_stat test_support test_sys test_timeout test_urllib test_urllib2 test_urllib2net test_urllib_response test_urllibnet test_xmlrpc
    • asyncio: test_asyncio test_inspect test_sys_settrace test_unittest
    • email.utils: test_email
      • http.server: test_robotparser test_urllib2_localnet
      • logging.handlers: test_concurrent_futures test_pkgutil
      • urllib.request: test_http_cookiejar test_pydoc test_sax test_site
    • http.client: test_docxmlrpc test_hashlib test_ucn test_unicodedata test_wsgiref
    • http.server:
      • pydoc: test_enum
    • mailbox: test_genericalias
    • multiprocessing: test_compileall test_concurrent_futures test_fcntl test_memoryview test_multiprocessing_main_handling test_re
      • concurrent.futures.process: test_concurrent_futures
    • platform: test__locale test__osx_support test_android test_baseexception test_builtin test_cmath test_ctypes test_math test_mimetypes test_platform test_posix test_regrtest test_shutil test_strptime test_sysconfig test_time test_winreg
    • ssl: test_venv
    • urllib.request:
      • pathlib: test_ast test_dbm_sqlite3 test_ensurepip test_importlib test_launcher test_pathlib test_runpy test_tarfile test_tempfile test_tomllib test_tools test_traceback test_unparse test_winapi test_zipapp test_zipfile test_zoneinfo test_zstd
    • uuid:
      • wave: test_wave

Legend:

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

}

#[cfg(all(unix, not(target_os = "redox")))]
#[cfg(all(unix, not(any(target_os = "redox", target_os = "android"))))]

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.

@youknowone youknowone merged commit e36cd99 into RustPython:main May 13, 2026
26 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.

2 participants