Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix broken symlinks for expected images on WSL #25792

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2023

Conversation

scottshambaugh
Copy link
Contributor

@scottshambaugh scottshambaugh commented Apr 29, 2023

PR summary

On WSL for image comparison tests, when placing the expected image in the results_images folder, symlinks are broken when accessing those images afterwards via the Windows interface. The symlink command does not fail, so the error logic does not catch it and we need to add a check for this special case.

Before, when opening an *-expected.png file:
image

After, the image opens correctly.

PR checklist

Check for WSL2 and WSL1

Cleanup
@tacaswell
Copy link
Member

Thanks for this!

Is there any documentation on the reported uname in WSL?

@scottshambaugh
Copy link
Contributor Author

scottshambaugh commented May 1, 2023

Good question! The best I can find is microsoft/WSL#4555, so I added a check for WSL1 as well.

@scottshambaugh scottshambaugh force-pushed the wsl_expected_images branch from ceed678 to aa0cda7 Compare May 2, 2023 15:01
@scottshambaugh
Copy link
Contributor Author

scottshambaugh commented May 2, 2023

Thanks all, cleaned that up a bit.

FYI, on Windows 10, platform.uname().release returns '10' so I don't see "microsoft" getting stepped on in the future. (Not that that unintentionally matching a different platform would break anything, the fallback behavior is just a little slower/more disk space intensive)

@scottshambaugh scottshambaugh added this to the v3.7.2 milestone May 8, 2023
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this is broken in WSL as stated and fixed with this change.

@QuLogic QuLogic merged commit 0134e6d into matplotlib:main May 16, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request May 16, 2023
QuLogic added a commit that referenced this pull request May 16, 2023
…792-on-v3.7.x

Backport PR #25792 on branch v3.7.x (Fix broken symlinks for expected images on WSL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants