Update dependency chardet to v7.7.0 #125

Merged
timatlee merged 1 commits from renovate/chardet-7.x into main 2026-10-17 20:35:51 -06:00
Collaborator

This PR contains the following updates:

Package Update Change
chardet (changelog) minor ==7.6.0 → ==7.7.0

Release Notes

chardet/chardet (chardet)

v7.7.0

Compare Source

Big release: raising max_bytes to cover a huge input no longer makes detect() slow, every answer now decodes the window it was detected from, and markup declarations are read the way browsers read them. A lot of this came from new contributors, so thank you all!

Performance

  • Raising max_bytes on large inputs no longer gets slow. On compiled wheels, detect(data, max_bytes=len(data)) on 272 MiB takes about 0.2s for cp1252 and 0.5s for Shift_JIS, down from several seconds. UTF-8 validation and a final decode of the winner still read the whole window, and the other stages stop at a 256 KiB evidence cap (ADR-0006). The default 200 KB cap is still the fastest path, and default calls are unchanged.
  • The pure-Python wheel on CPython scores bigram models through operator.itemgetter instead of a Python loop, making detect() about 1.25x faster and detect_all() about 1.35x faster. (#​404, thanks @​deadstrobe5)
  • Fixed three scans that went quadratic on hostile input: the UTF-7 + scan on line-wrapped base64 (128 KiB went from 5.4s to 1.2ms), unclosed <meta and <?xml tags in the markup scan, and the EBCDIC charset-declaration regex. (#​403, thanks @​Samin061)

Bug Fixes

  • Every answer now decodes the examined window under the name you get back. BOMs, BOM-less UTF-16/32 null patterns, ISO-2022/HZ escapes, and <meta charset> declarations used to be trusted without decoding the rest of the window, so a confident answer could still raise further in. The 5.x/6.x display names (EUC-JP, SHIFT_JIS, Big5, ISO-2022-JP) are only used when those narrower codecs decode it too. (#​394 and #​396, thanks @​Samin061)
  • Markup declarations follow the WHATWG prescan: declarations inside comments are ignored, a charset= inside another attribute (like a refresh URL) no longer beats a real <meta charset>, quoted or spaced content charsets work, and an ASCII page declaring utf-16le no longer comes back as UTF-16-LE. (#​389 and #​398, thanks @​SashaMIT and @​xiehuanyi)
  • PEP 263 cookies resolve the way tokenize.detect_encoding resolves them, including only counting a line-2 cookie when line 1 is blank or a comment. (#​391, thanks @​xiehuanyi)
  • Fixed BOM-bearing UTF-32 coming back as UTF-16 when max_bytes cuts a code unit. (#​405, thanks @​AryanRG)
  • Fixed language labels on Unicode text tilting toward accent-heavy languages, so a French paragraph with a few accents no longer comes back as Hungarian. Mislabels on the test corpus's Unicode files dropped from 140 to 104.
  • Fixed a mostly-ASCII Windows-1252 file with a single Ö detecting as HP-Roman8, and English with a lone É detecting as MacRoman. (#​383, thanks @​aadsm)
  • Fixed null-separated records like find -print0 output coming back as UTF-16-LE with Chinese as the language.
  • prefer_superset=True no longer swaps in a code page that can't decode the data, and now respects include_encodings/exclude_encodings. (#​393, thanks @​00200200)
  • chardetect and UniversalDetector no longer mistake input cut exactly at the byte cap for the whole stream. (#​392, thanks @​00200200)
  • lookup_encoding's cache is capped at 1024 entries, since charset names come from untrusted markup. (#​390, thanks @​Samin061)
  • Plus smaller fixes to detect_all() ranking, EBCDIC XML MIME types, and the deprecated chardet.equivalences shim. The changelog has the full list.

Improvements

  • New -m/--mime-type flag for chardetect shows the MIME type next to the encoding, like file -i. (#​384, thanks @​smi11 for the request)
  • Visual-order Hebrew is now detected, and cp864 Arabic is trained on contextually shaped text in visual order, the way real cp864 systems stored it.
  • EncodingInfo.is_multibyte is now is_multibyte_cjk. The old name still works with a DeprecationWarning and goes away in 8.0.
  • pipeline/markup.py is now compiled by mypyc (15 modules total), and CI enforces 100% test coverage.

Full Changelog: https://github.com/chardet/chardet/compare/7.6.0...7.7.0


Configuration

📅 Schedule: (in timezone America/Edmonton)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Update | Change | |---|---|---| | [chardet](https://github.com/chardet/chardet) ([changelog](https://chardet.readthedocs.io/en/latest/changelog.html)) | minor | `==7.6.0` → `==7.7.0` | --- ### Release Notes <details> <summary>chardet/chardet (chardet)</summary> ### [`v7.7.0`](https://github.com/chardet/chardet/releases/tag/7.7.0) [Compare Source](https://github.com/chardet/chardet/compare/7.6.0...7.7.0) Big release: raising `max_bytes` to cover a huge input no longer makes `detect()` slow, every answer now decodes the window it was detected from, and markup declarations are read the way browsers read them. A lot of this came from new contributors, so thank you all! #### Performance - Raising `max_bytes` on large inputs no longer gets slow. On compiled wheels, `detect(data, max_bytes=len(data))` on 272 MiB takes about 0.2s for cp1252 and 0.5s for Shift_JIS, down from several seconds. UTF-8 validation and a final decode of the winner still read the whole window, and the other stages stop at a 256 KiB evidence cap (ADR-0006). The default 200 KB cap is still the fastest path, and default calls are unchanged. - The pure-Python wheel on CPython scores bigram models through `operator.itemgetter` instead of a Python loop, making `detect()` about 1.25x faster and `detect_all()` about 1.35x faster. ([#&#8203;404](https://github.com/chardet/chardet/issues/404), thanks [@&#8203;deadstrobe5](https://github.com/deadstrobe5)) - Fixed three scans that went quadratic on hostile input: the UTF-7 `+` scan on line-wrapped base64 (128 KiB went from 5.4s to 1.2ms), unclosed `<meta` and `<?xml` tags in the markup scan, and the EBCDIC charset-declaration regex. ([#&#8203;403](https://github.com/chardet/chardet/issues/403), thanks [@&#8203;Samin061](https://github.com/Samin061)) #### Bug Fixes - Every answer now decodes the examined window under the name you get back. BOMs, BOM-less UTF-16/32 null patterns, ISO-2022/HZ escapes, and `<meta charset>` declarations used to be trusted without decoding the rest of the window, so a confident answer could still raise further in. The 5.x/6.x display names (`EUC-JP`, `SHIFT_JIS`, `Big5`, `ISO-2022-JP`) are only used when those narrower codecs decode it too. ([#&#8203;394](https://github.com/chardet/chardet/issues/394) and [#&#8203;396](https://github.com/chardet/chardet/issues/396), thanks [@&#8203;Samin061](https://github.com/Samin061)) - Markup declarations follow the WHATWG prescan: declarations inside comments are ignored, a `charset=` inside another attribute (like a refresh URL) no longer beats a real `<meta charset>`, quoted or spaced `content` charsets work, and an ASCII page declaring `utf-16le` no longer comes back as UTF-16-LE. ([#&#8203;389](https://github.com/chardet/chardet/issues/389) and [#&#8203;398](https://github.com/chardet/chardet/issues/398), thanks [@&#8203;SashaMIT](https://github.com/SashaMIT) and [@&#8203;xiehuanyi](https://github.com/xiehuanyi)) - PEP 263 cookies resolve the way `tokenize.detect_encoding` resolves them, including only counting a line-2 cookie when line 1 is blank or a comment. ([#&#8203;391](https://github.com/chardet/chardet/issues/391), thanks [@&#8203;xiehuanyi](https://github.com/xiehuanyi)) - Fixed BOM-bearing UTF-32 coming back as UTF-16 when `max_bytes` cuts a code unit. ([#&#8203;405](https://github.com/chardet/chardet/issues/405), thanks [@&#8203;AryanRG](https://github.com/AryanRG)) - Fixed language labels on Unicode text tilting toward accent-heavy languages, so a French paragraph with a few accents no longer comes back as Hungarian. Mislabels on the test corpus's Unicode files dropped from 140 to 104. - Fixed a mostly-ASCII Windows-1252 file with a single `Ö` detecting as HP-Roman8, and English with a lone `É` detecting as MacRoman. ([#&#8203;383](https://github.com/chardet/chardet/issues/383), thanks [@&#8203;aadsm](https://github.com/aadsm)) - Fixed null-separated records like `find -print0` output coming back as UTF-16-LE with Chinese as the language. - `prefer_superset=True` no longer swaps in a code page that can't decode the data, and now respects `include_encodings`/`exclude_encodings`. ([#&#8203;393](https://github.com/chardet/chardet/issues/393), thanks [@&#8203;00200200](https://github.com/00200200)) - `chardetect` and `UniversalDetector` no longer mistake input cut exactly at the byte cap for the whole stream. ([#&#8203;392](https://github.com/chardet/chardet/issues/392), thanks [@&#8203;00200200](https://github.com/00200200)) - `lookup_encoding`'s cache is capped at 1024 entries, since charset names come from untrusted markup. ([#&#8203;390](https://github.com/chardet/chardet/issues/390), thanks [@&#8203;Samin061](https://github.com/Samin061)) - Plus smaller fixes to `detect_all()` ranking, EBCDIC XML MIME types, and the deprecated `chardet.equivalences` shim. The [changelog](https://chardet.readthedocs.io/en/latest/changelog.html) has the full list. #### Improvements - New `-m`/`--mime-type` flag for `chardetect` shows the MIME type next to the encoding, like `file -i`. ([#&#8203;384](https://github.com/chardet/chardet/issues/384), thanks [@&#8203;smi11](https://github.com/smi11) for the request) - Visual-order Hebrew is now detected, and cp864 Arabic is trained on contextually shaped text in visual order, the way real cp864 systems stored it. - `EncodingInfo.is_multibyte` is now `is_multibyte_cjk`. The old name still works with a `DeprecationWarning` and goes away in 8.0. - `pipeline/markup.py` is now compiled by mypyc (15 modules total), and CI enforces 100% test coverage. **Full Changelog**: <https://github.com/chardet/chardet/compare/7.6.0...7.7.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone America/Edmonton) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjYuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE2Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
renovate-bot added 1 commit 2026-10-17 19:00:19 -06:00
Update dependency chardet to v7.7.0
Build Docker Image / build (pull_request) Successful in 2m30s
2dda0c5305
timatlee merged commit 5a52082141 into main 2026-10-17 20:35:51 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timatlee/cloudflare-ddns-docker-updated#125