Skip to content

[2.8] Add regression test for detach() on non-seekable streams#634

Merged
GrahamCampbell merged 1 commit intoguzzle:2.8from
eyupcanakman:fix/detach-non-seekable-630
Mar 5, 2026
Merged

[2.8] Add regression test for detach() on non-seekable streams#634
GrahamCampbell merged 1 commit intoguzzle:2.8from
eyupcanakman:fix/detach-non-seekable-630

Conversation

@eyupcanakman
Copy link

@eyupcanakman eyupcanakman commented Mar 4, 2026

Stream::detach() used to call ftell(), feof(), and stream_get_meta_data()
on the resource after clearing the internal reference. On non-seekable stream types
(e.g. tcp_socket/ssl), ftell() raises a TypeError on PHP 8.

Those calls were removed from detach(), but no test covered this scenario.
Add a regression test using a popen pipe (non-seekable) to confirm detach()
returns the resource cleanly and leaves the Stream object in the expected
detached state.

Fixes #630.

@GrahamCampbell GrahamCampbell merged commit 27b6714 into guzzle:2.8 Mar 5, 2026
23 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.

Calling detach() on non-seekable stream raises fatal error

2 participants