Repository navigation
Resolve GitHub code quality findings and clarify descriptor ownership - #16
Merged
Merged
Conversation
|
|
||
| def test_open_at_closes_when_cloexec_setup_fails(self): | ||
| for native_openat in (False, True): | ||
| descriptor = os.open(self.root_path, os.O_RDONLY) |
| with mock.patch.object(v2.os, 'supports_dir_fd', supported, create=True): | ||
| with mock.patch.object(v2, '_set_cloexec', side_effect=OSError(errno.EIO, 'Flag failure')): | ||
| with self.assertRaises(OSError): | ||
| v2._open_at(123, 'cgroup.procs', os.O_RDONLY) |
|
|
||
| with mock.patch.object(v2, '_set_cloexec', side_effect=fail_cloexec): | ||
| with self.assertRaises(OSError): | ||
| tree._directory(()) |
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.
GitHub Code Quality reports 17 open findings on
master. This change addresses every finding while preserving the Python 2.7 / Python 3.6+ API contract and existing runtime behavior._open_at. Add three regression tests covering root, native/procfs open and duplicate-descriptor cleanup; verify the root remains usable after duplicate setup failure.Noneexplicitly for skipped descriptor writes and unsuccessful tree/group/VM lookups. Preserve existing results.==. UsingassertNotEqualhere could bypass the custom equality method on Python 2.DictOrFlagFileandBaseFileInterfaceimports.Popen; retain exactly the same program and stdin gate.Validation: all 137 tests pass locally on Python 3.12; source and universal-wheel builds pass strict
twine check;git diff --checkpasses. Independent code review found no actionable defects. All 16 GitHub checks pass, including Python 2.7 and 3.6–3.15, distribution installation, Linux cgroup integration, CodeQL, and Code Quality. Passing CI, passing Code Quality analysis.No finding has been dismissed or suppressed. No version bump or release is included.