Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Sep 7, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

YO4 and others added 2 commits September 8, 2025 00:23
…ion active

Using IO#each_codepoint together with IO#ungetc causes an unwanted exception when encoding conversion is active.

C:\>ruby -e "open('NUL', 'rt') { |f| f.ungetc('aa'); f.each_codepoint { |c| p c }}"
97
-e:1:in 'IO#each_codepoint': byte oriented read for character buffered IO (IOError)
        from -e:1:in 'block in <main>'
        from -e:1:in 'Kernel#open'
        from -e:1:in '<main>'

Fixes [Bug #21131]
One example to describe how `*` works actually prints a warning:

```
$ ruby -we "sprintf('%d', 20, 14)"
=> -e:1: warning: too many arguments for format string
```

I think it's better to not use examples that print warnings, so I
propose to merge `*` docs with "width" specifier docs, and only include
the "correct" example.

After I believe `*` is not an actual flag, but a special value that the
width specifier can take.

Mention `*` special value in initial summary as well.
@pull pull bot locked and limited conversation to collaborators Sep 7, 2025
@pull pull bot added the ⤵️ pull label Sep 7, 2025
@pull pull bot merged commit 1e7ee6a into turkdevops:master Sep 7, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants