Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Process] Fix handling empty path found in the PATH env var with ExecutableFinder#58711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedOct 29, 2024
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Issues-
LicenseMIT

@alexandre-daubois
Copy link
Member

alexandre-daubois commentedOct 30, 2024
edited
Loading

What about:

diff --git a/src/Symfony/Component/Process/Tests/ExecutableFinderTest.php b/src/Symfony/Component/Process/Tests/ExecutableFinderTest.phpindex a1b8d6d54b..5052fc0d6b 100644--- a/src/Symfony/Component/Process/Tests/ExecutableFinderTest.php+++ b/src/Symfony/Component/Process/Tests/ExecutableFinderTest.php@@ -138,6 +138,21 @@ class ExecutableFinderTest extends TestCase         $this->assertSamePath($target.'.BAT', $result);     }+    public function testEmptyDirInPath()+    {+        putenv(sprintf('PATH=%s:', \dirname(\PHP_BINARY)));++        touch('executable');+        chmod('executable', 0700);++        $finder = new ExecutableFinder();+        $result = $finder->find('executable');++        $this->assertSame('./executable', $result);++        unlink('executable');+    }+     private function assertSamePath($expected, $tested)     {         if ('\\' === \DIRECTORY_SEPARATOR) {

The result before your fix:

/Users/.../PhpstormProjects/symfony/./executable

After this fix:

./executable

@nicolas-grekas
Copy link
MemberAuthor

Perfect thanks! PR updated.

@nicolas-grekasnicolas-grekas merged commit44ce9fa intosymfony:5.4Oct 31, 2024
11 of 12 checks passed
@nicolas-grekasnicolas-grekas deleted the process-fix-empty branchOctober 31, 2024 07:36
nicolas-grekas added a commit that referenced this pull requestNov 4, 2024
…y` block (alexandre-daubois)This PR was merged into the 5.4 branch.Discussion----------[Process] Improve test cleanup by unlinking in a `finally` block| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITFollwup for#58711, I realized afterwards that we may unlink in `finally` block to ensure proper test clean up in case something goes wrong.Commits-------5c547c9 [Process] Improve test cleanup by unlinking in a `finally` block
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alexandre-dauboisalexandre-dauboisalexandre-daubois approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

3 participants
@nicolas-grekas@alexandre-daubois@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp