Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-wcwidth for openSUSE:Factory checked in at 2026-08-24 12:01:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wcwidth (Old) and /work/SRC/openSUSE:Factory/.python-wcwidth.new.1258 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wcwidth" Mon Aug 24 12:01:42 2026 rev:27 rq:1373065 version:0.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wcwidth/python-wcwidth.changes 2026-08-09 21:33:43.526878016 +0200 +++ /work/SRC/openSUSE:Factory/.python-wcwidth.new.1258/python-wcwidth.changes 2026-08-24 12:02:30.873543743 +0200 @@ -1,0 +2,6 @@ +Sat Aug 22 13:34:24 UTC 2026 - Dirk Müller <[email protected]> + +- update to 0.8.2: + * bugfix: IndexError when 'n' exceeds length + +------------------------------------------------------------------- Old: ---- wcwidth-0.8.1.tar.gz New: ---- wcwidth-0.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wcwidth.spec ++++++ --- /var/tmp/diff_new_pack.1QBg0t/_old 2026-08-24 12:02:31.753574790 +0200 +++ /var/tmp/diff_new_pack.1QBg0t/_new 2026-08-24 12:02:31.755574861 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-wcwidth -Version: 0.8.1 +Version: 0.8.2 Release: 0 Summary: Number of Terminal column cells of wide-character codes License: MIT ++++++ wcwidth-0.8.1.tar.gz -> wcwidth-0.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/docs/intro.rst new/wcwidth-0.8.2/docs/intro.rst --- old/wcwidth-0.8.1/docs/intro.rst 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/docs/intro.rst 2026-06-29 19:30:51.000000000 +0200 @@ -654,6 +654,10 @@ History ======= +0.8.2 *2026-06-29* + * **Bugfix** Do not raise IndexError when given legacy POSIX ``n`` argument to `wcswidth()`_ or + `wcstwidth()`_ exceed string length without raising IndexError + 0.8.1 *2026-06-08* * **Improved** `wcstwidth()`_ with new ``zeroer``, ``narrow_wider``, and ``narrow_zeroer`` Corrections_. `PR #226`_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/pyproject.toml new/wcwidth-0.8.2/pyproject.toml --- old/wcwidth-0.8.1/pyproject.toml 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/pyproject.toml 2026-06-29 19:30:51.000000000 +0200 @@ -4,7 +4,7 @@ [project] name = "wcwidth" -version = "0.8.1" # don't forget to also update wcwidth/__init__.py:__version__ +version = "0.8.2" # don't forget to also update wcwidth/__init__.py:__version__ description = "Measures the displayed width of unicode strings in a terminal" readme = "README.rst" keywords = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/tests/test_core.py new/wcwidth-0.8.2/tests/test_core.py --- old/wcwidth-0.8.1/tests/test_core.py 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/tests/test_core.py 2026-06-29 19:30:51.000000000 +0200 @@ -497,6 +497,12 @@ assert wcwidth.wcswidth('a\u200D') == 1 +def test_wcswidth_n_exceeds_length(): + """Verify wcswidth() with n > len(string) does not raise IndexError.""" + assert wcwidth.wcswidth('hello', n=999) == 5 + assert wcwidth.wcswidth('\u30B3\u30F3', n=999) == 4 + + def test_soft_hyphen(): # Test SOFT HYPHEN, category 'Cf' usually are zero-width, but most # implementations agree to draw it was '1' cell, visually diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/tests/test_term_overrides.py new/wcwidth-0.8.2/tests/test_term_overrides.py --- old/wcwidth-0.8.1/tests/test_term_overrides.py 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/tests/test_term_overrides.py 2026-06-29 19:30:51.000000000 +0200 @@ -418,6 +418,13 @@ assert overrides.narrow_wider == () [email protected]('func', [wcwidth.wcstwidth, wcwidth.width]) +def test_narrow_wider_width(func): + """Verify width() & wcstwidth() match result of narrow_wider overrides.""" + assert wcwidth.wcswidth('\u261d') == 1 + assert func('\u261d', term_program='kitty') == 2 + + @pytest.mark.parametrize('codepoint', [ '\u00ad', '\u0600', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/wcwidth/__init__.py new/wcwidth-0.8.2/wcwidth/__init__.py --- old/wcwidth-0.8.1/wcwidth/__init__.py 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/wcwidth/__init__.py 2026-06-29 19:30:51.000000000 +0200 @@ -78,4 +78,4 @@ # Using 'hatchling', it does not seem to provide the pyproject.toml nicety, "dynamic = ['version']" # like flit_core, maybe there is some better way but for now we have to duplicate it in both places # Prefer the installed distribution version when available (helps test environments) -__version__ = '0.8.1' # don't forget to also update pyproject.toml:version +__version__ = '0.8.2' # don't forget to also update pyproject.toml:version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcwidth-0.8.1/wcwidth/_wcswidth.py new/wcwidth-0.8.2/wcwidth/_wcswidth.py --- old/wcwidth-0.8.1/wcwidth/_wcswidth.py 2026-06-08 07:56:10.000000000 +0200 +++ new/wcwidth-0.8.2/wcwidth/_wcswidth.py 2026-06-29 19:30:51.000000000 +0200 @@ -98,7 +98,7 @@ _wcwidth = wcwidth if ambiguous_width == 1 else lambda c: wcwidth(c, 'auto', ambiguous_width) - end = len(pwcs) if n is None else n + end = len(pwcs) if n is None else min(n, len(pwcs)) total_width = 0 idx = 0 @@ -262,7 +262,7 @@ # Select wcwidth call pattern for best lru_cache performance _wcwidth = wcwidth if ambiguous_width == 1 else lambda c: wcwidth(c, 'auto', ambiguous_width) - end = len(pwcs) if n is None else n + end = len(pwcs) if n is None else min(n, len(pwcs)) total_width = 0 idx = 0
