fix: add autodie exception throwing to __sysopen#246
Merged
atoomic merged 1 commit intocpanel:masterfrom Feb 28, 2026
Merged
Conversation
__sysopen had zero autodie integration while __open properly throws autodie::exception at all failure points. When users had `use autodie 'sysopen'`, failures would silently return false instead of throwing exceptions. Changes: - Add _caller_has_autodie_for_sysopen() detection function - Add _throw_autodie_sysopen() exception builder - Throw autodie exceptions at all 6 failure points in __sysopen: O_NOFOLLOW/ELOOP, broken symlink/ENOENT, circular symlink/ELOOP, directory/EISDIR, O_EXCL/EEXIST, non-existent/ENOENT - Update import() cache to also detect sysopen-specific autodie hints - Add t/autodie_sysopen.t (9 subtests) and t/autodie_sysopen_reverse.t (3 subtests) covering both load orders Co-Authored-By: Claude Opus 4.6 <[email protected]>
atoomic
approved these changes
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add autodie integration to
__sysopen— currentlyuse autodie 'sysopen'silently fails on all mocked sysopen errors.Why
__openalready has autodie support (PR #208), but__sysopenwas never updated. When a caller usesuse autodie 'sysopen'and a mocked sysopen fails (ENOENT, EEXIST, EISDIR, etc.), autodie never throws — the error is silently swallowed. This creates a behavioral mismatch betweenopenandsysopenunder autodie.How
_caller_has_autodie_for_sysopen()— detects autodie viacaller(N)[10]hints hash (keys:autodie,Fatal::sysopen,autodie::sysopen)_throw_autodie_sysopen()— constructs and throwsautodie::exceptionwithfunction => 'CORE::sysopen'%_autodie_callersimport-time cache to detect sysopen hints alongside open__sysopen(EISDIR, EEXIST, ENOENT, permission errors)return undefconvention from PR fix: sysopen ENOENT for O_WRONLY/O_RDWR without O_CREAT #242Testing
t/autodie_sysopen.t— 12 tests: ENOENT, EEXIST, EISDIR with autodie, plus non-autodie control casest/autodie_sysopen_reverse.t— 6 tests: verifies import order (autodie before Test::MockFile) works via CHECK block caching🤖 Generated with Claude Code