Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

  • Reproduce pip install ujson failure and gather baseline logs
  • Investigate ssl read handling leading to SSLWantReadError on blocking sockets
  • Implement minimal fix and add/adjust tests if needed
  • Re-run pip install ujson scenario and targeted ssl tests
  • Final review, code review, and security checks
Original prompt

This section details on the original issue you should resolve

<issue_title>pip install ujson: pip._vendor.urllib3.exceptions.SSLError: The operation did not complete (read)</issue_title>
<issue_description>Hi! I'm trying to install ujson (it's optional dependency for xonsh shell) on mac:

rustpython -m pip install ujson

Result:

Details
Defaulting to user installation because normal site-packages is not writeable
Collecting ujson
  Downloading ujson-5.11.0.tar.gz (7.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/7.2 MB ? eta -:--:--<bound method Thread._bootstrap of <_RefreshThread(Thread-1, started daemon 2)>>

     ━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━ 3.1/7.2 MB 8.8 MB/s eta 0:00:01
ERROR: Exception:
Traceback (most recent call last):
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/urllib3/response.py", line 561, in read
    data = self._fp_read(amt) if not fp_closed else b""
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/urllib3/response.py", line 527, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 98, in read
    data: bytes = self.__fp.read(amt)
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/http/client.py", line 465, in read
    s = self.fp.read(amt)
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/socket.py", line 714, in readinto
    raise
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/socket.py", line 707, in readinto
    return self._sock.recv_into(b)
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/ssl.py", line 1148, in read
    raise
  File "/Users/pc/.cargo/git/checkouts/rustpython-63090cdce5e18442/7c3bc5e/crates/pylib/Lib/ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
ssl_error.SSLWantReadError: The operation did not complete (read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper
    status = _inner_run()
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/base_command.py", line 100, in _inner_run
    self.handle_pip_version_check(options)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
    return self.run(options, args)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
    return self.run(options, args)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/req_command.py", line 91, in wrapper
    raise
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/req_command.py", line 85, in wrapper
    return func(self, options, args)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/commands/install.py", line 516, in run
    return ERROR
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/commands/install.py", line 389, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 110, in resolve
    raise ResolutionTooDeepError from None
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 100, in resolve
    collected.requirements, max_rounds=limit_how_complex_resolution_can_be
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 601, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 436, in resolve
    raise ResolutionImpossible(e.criterion.information) from e
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 434, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 150, in _add_to_criteria
    if not criterion.candidates:
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_vendor/resolvelib/structs.py", line 194, in __bool__
    return bool(self._sequence)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 165, in __bool__
    self._bool = any(self)
  File "/U...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes RustPython/RustPython#6491

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

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