Repository navigation
Conversation
…NE-DRIVE-MAP-OSERROR) DriveMap.__enter__ handled only FileExistsError. A prefix whose dosdevices folder cannot be written aborted the run with a traceback before any test. Any OSError while mapping now sets a note and leaves the drive unmapped; the scratch folder is removed as before. Tests: the old drive-setup test asserted the traceback; it now checks the note, the cleanup and that __enter__ does not raise. A second test covers a scratch folder that cannot be created.
This was referenced Nov 24, 2026
4 tasks done
Contributor
|
Reviewed 3de809c: DriveMap now notes and survives real OSErrors instead of aborting. The PR's 64 tests pass on its tree; copied to main, its two DriveMap tests fail there as expected (main still raises), so they test the fix. A no-mock probe on both trees (read-only dosdevices, unusable temp dir, end-to-end runner) shows main aborting with a traceback and exit 1 before any test, while this branch notes why, cleans up the scratch folder and finishes with "[PASS] ok"; control mapping unchanged. The branch is older than main's wineserver/--jobs work but merges cleanly into current main, where the suite passes (3 wineserver errors in my environment are environmental and present on main without this PR). AI-assisted review. Recommendation: Merge |
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.
Claimed in the coordination issue as: WINE-DRIVE-MAP-OSERROR (#14 (comment))
What was wrong
scripts/run_wine_tests.py,DriveMap.__enter__(around line 102 before this change). It handled onlyFileExistsErroraroundos.symlink. Any otherOSError, such asPermissionErrorfrom a read-only Wine prefix, escaped__enter__and abortedmainwith a traceback before any test started. The otherOSErrorhandlers in the file print a message and return.Reproduction on the unfixed branch (uid 1000, not root):
Output: a
PermissionError: [Errno 13] Permission deniedtraceback from__enter__at line 102, exit status 1.What changed
DriveMap.__enter__wraps the mapping inexcept OSError as e. It setsself.notetocannot map drive d: <strerror>: the run goes on without it, and returns unmapped. The existingfinallyremoves the scratch folder. TheFileExistsErrorpath is unchanged.tests/test_run_wine_tests.py: the old testtest_failed_drive_setup_removes_scratch_directoryasserted the traceback, so it is replaced bytest_an_unwritable_prefix_is_noted_and_the_run_goes_on_unmapped. It patchesos.symlinkto raisePermissionErrorand checks the note,drive.link is None, the removed scratch folder and that__enter__does not raise. A new test,test_a_scratch_folder_that_cannot_be_made_is_noted_too, coversmkdtempfailing.Tested
cannot map drive d: Permission denied: the run goes on without it, then0 passed, 0 failed, 0 skipped under Wine (0 tests), exit status 0. Nowine-drive-*folder is left in/tmp.python3 -I tests/test_run_wine_tests.py:Ran 64 tests ... OKafter the fix.scripts/run_wine_tests.pyrestored to origin/main:FAILED (errors=2), both new tests error on the unfixed code.makedirsfailing after the scratch folder is made (scratch removed,dosdevicesleft empty),D:/root withsymlinkfailing, anOSErrorwith nostrerror(message falls back tostr(e)).python3 -m compileall -q scripts tests: ok.python3 -I tests/test_text_write_line_endings.py: OK.python3 -I scripts/check_no_game_data.py scripts/run_wine_tests.py tests/test_run_wine_tests.py: exit 0.git diff --check: clean.python3 -I tests/test_run_wine_test_fixtures.py:Ran 6 tests ... OK.python3 -I tests/test_tool_stdout_encoding.py: 1 failure,tools/native_pso_hashes.pyis not a main block that setserrors='replace'. That file is not in this change. I did not run that test on origin/main.Not tested: real Wine, Windows and macOS runs. The unit tests patch
os.symlink; the real permission case was checked only by the manual reproduction above, which used a read-only folder as uid 1000.Other PRs: PR #756 changes
scripts/run_wine_tests.pyat the end of the file (the__main__block, after line 410). This PR changes lines 67 to 110. The hunks do not overlap.AI-assisted (Claude Code).