Skip to content
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

Raise ConanException if source patch does not exist in export_conandata_patches #17294

Merged

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Nov 8, 2024

Changelog: Fix: Raise ConanException if source patch does not exist in export_conandata_patches.
Docs: Omit

Trying to fix tests that fail in Python 3.13: #17205

I found that now the error thrown by shutil.copy2 has changed in Windows. So if the source patch does not exist now the error is different.

It was like this:

FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/hr/t3_1lzj9145g383b4zyj67d40000gn/T/tmpjqj9cq99conans/path with spaces/patches/mypatch.patch'

now it's like this:

FileNotFoundError: [WinError 3] The system cannot find the path specified

So I think it would be better to throw that error ourselves si that we always output a meaningful message:

ConanException: Patch file does not exist: '/private/var/folders/hr/t3_1lzj9145g383b4zyj67d40000gn/T/tmpuewtmlhpconans/path with spaces/patches/mypatch.patch'

@czoido czoido changed the title Raise ConanException ir source patch does not exist in export_conandata_patches Raise ConanException if source patch does not exist in export_conandata_patches Nov 8, 2024
@czoido czoido added this to the 2.10.0 milestone Nov 8, 2024
@memsharded memsharded merged commit c74f05f into conan-io:develop2 Nov 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants