Skip to content

Fix File.stream!/3 argument order for Elixir 1.20+#6

Open
remotecom wants to merge 1 commit into
benfalk:masterfrom
remoteoss:fix/elixir-1.20-file-stream-arg-order
Open

Fix File.stream!/3 argument order for Elixir 1.20+#6
remotecom wants to merge 1 commit into
benfalk:masterfrom
remoteoss:fix/elixir-1.20-file-stream-arg-order

Conversation

@remotecom

Copy link
Copy Markdown

Elixir 1.20 swapped the modes / line_or_bytes arguments of File.stream!/3:

# old (deprecated):
File.stream!(path, modes, line_or_bytes)
# new:
File.stream!(path, line_or_bytes, modes)

The old 3-arg form is a hard deprecation in 1.20 (warning today) that becomes a compile/runtime error in 1.21, per the Elixir 1.20 CHANGELOG.

WordSmith.RemoveAccents calls it at module-compile time with only default arguments (modes [], line_or_bytes :line), so this collapses the call to File.stream!(@accents_file) — equivalent on every supported Elixir version, and it silences the deprecation. No behaviour change.

Elixir 1.20 swapped the modes/line_or_bytes arguments of File.stream!/3. The old 3-arg form File.stream!(path, modes, line_or_bytes) is a hard deprecation that becomes a compile/runtime error in 1.21.

This call passed only defaults (modes []), so it collapses to File.stream!(path), which is equivalent on every supported Elixir version.
@remotecom remotecom closed this Jun 18, 2026
@remotecom remotecom reopened this Jun 19, 2026
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.

1 participant