Skip to content

Backport "Remove locale dependent FileSystemException check" to 3.3 LTS #258

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
Apr 23, 2025

Conversation

tgodzik
Copy link

@tgodzik tgodzik commented Apr 22, 2025

Backports scala#21633 to the 3.3.7.

PR submitted by the release tooling.
[skip ci]

Fin SourceFile, files that do not exist are expected and related exceptions
should be ignored. There are two relevant cases:

    scala> java.nio.file.Files.newInputStream(java.nio.file.FileSystems.getDefault().getPath("does-not-exist"))
    java.nio.file.NoSuchFileException: does-not-exist

    scala> java.nio.file.Files.newInputStream(java.nio.file.FileSystems.getDefault().getPath("regular-file-instead-of-directory/filename"))
    java.nio.file.FileSystemException: regular-file-instead-of-directory/filename: Not a directory

Ideally, other I/O errors would be propagated to the caller.

However, there is no reliable way to distinguish them based on the
exceptions alone. In particular, the message cannot be checked, because
it depends on the operating system and it is localized.

Revert the addition of the check and just accept this.

[Cherry-picked aa91e9f]
Base automatically changed from backport-lts-3.3-21510 to lts-3.3 April 23, 2025 08:04
@tgodzik
Copy link
Author

tgodzik commented Apr 23, 2025

No regressions detected in the community build up to backport-lts-3.3-21744.

Reference

@tgodzik tgodzik merged commit fef7d1d into lts-3.3 Apr 23, 2025
22 checks passed
@tgodzik tgodzik deleted the backport-lts-3.3-21633 branch April 23, 2025 08:04
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.

2 participants