ruby / ruby/net-imap

Warning: "historical binary regexp match /.../n against UTF-8 string"

Open
#219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
118
Forks
43
Avg merge
1d 23h
Merged PRs (30d)
26

Description

Seeing the following in logs:

warning: historical binary regexp match /.../n against UTF-8 string

This is triggered when UTF-8 strings that are not ascii_safe? are checked with the /[\r\n]/n regexp in send_string_data(str, tag) (command_data.rb:57).

Other than adding noise to the logs, I don't know if it makes any significant difference. If we were looking at MatchData, it would matter... but here we're just looking at match?.

See also: https://bugs.ruby-lang.org/issues/19767 and the commit links in the comments there.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at command_data.rb:57 in send_string_data(str, tag), where /[\r\n]/n is applied to non-ascii_safe? UTF-8 strings. Reproduce the warning and compare match? behavior, using Ruby issue 19767 as context; done means the warning is addressed without changing the intended string check.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.