Skip to content

[Backport 8.x] Fix File.open Ruby 3.2 regression in FileSystem::Uniquefile#478

Merged
OpenVoxProjectBot merged 1 commit into
8.xfrom
backport-450-to-8.x
Jun 9, 2026
Merged

[Backport 8.x] Fix File.open Ruby 3.2 regression in FileSystem::Uniquefile#478
OpenVoxProjectBot merged 1 commit into
8.xfrom
backport-450-to-8.x

Conversation

@OpenVoxProjectBot

Copy link
Copy Markdown
Contributor

Description

Backport of #450 to 8.x.

Ruby 3.2 changed the method call of File.open() such that it always
requires `perm` as an argument if you want to pass other `opts`.
It also started requiring opts to be splatted, instead of passed as a hash.

Old method definition:
```
open(filename, mode="r" [, opt]) → file
open(filename [, mode [, perm]] [, opt]) → file
open(filename, mode="r" [, opt]) {|file| block } → obj
open(filename [, mode [, perm]] [, opt]) {|file| block } → obj
```

New method definition:
```
open(path, mode = 'r', perm = 0666, **opts) → file
open(path, mode = 'r', perm = 0666, **opts) {|f| ... } → object
```

Signed-off-by: Jonas Verhofsté <jonas@verhofste.tech>
(cherry picked from commit 2476ad1)
@bastelfreak bastelfreak added the bug Something isn't working label Jun 9, 2026
@OpenVoxProjectBot OpenVoxProjectBot merged commit 502963b into 8.x Jun 9, 2026
19 checks passed
@OpenVoxProjectBot OpenVoxProjectBot deleted the backport-450-to-8.x branch June 9, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants