Skip to content

Fix checkPot for plural#19158

Merged
seanbudd merged 2 commits into
nvaccess:masterfrom
CyrilleB79:fixCheckPot
Nov 3, 2025
Merged

Fix checkPot for plural#19158
seanbudd merged 2 commits into
nvaccess:masterfrom
CyrilleB79:fixCheckPot

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes issue found while working on #19059

Summary of the issue:

In #19059, commit 9595711, an error is raised during check Pot:

scons: *** [tests\checkPot] IndexError : list index out of range
Traceback (most recent call last):
  File "D:\a\nvda\nvda\.venv\Lib\site-packages\SCons\Action.py", line 1434, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\a\nvda\nvda\tests\sconscript", line 21, in checkPotAction
    return checkPot.checkPot(source[0].abspath)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "D:\a\nvda\nvda\tests\checkPot.py", line 142, in checkPot
    msgid += getStringFromLine(line)
             ~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\a\nvda\nvda\tests\checkPot.py", line 201, in getStringFromLine
    quoted = line.split(" ", 1)[1]
             ~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Error: Process completed with exit code 1.

The test should pass or fail but no error should be raised.

The error occurs if a msgid command containing a multi-line string is followed by a msgid_plural command. This had probably never happened before the string introduced in #19059.

Description of user facing changes:

The Python script to check Pot does not raise an error before completing.

Description of developer facing changes:

N/A

Description of development approach:

Take into account the presence of msgid_plural token. Taken into account that a multi-line string in the msgid command can end:

  • either with a msgstr command
  • or a msgid_plural command

Testing strategy:

Tested in #19059

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@CyrilleB79 CyrilleB79 requested a review from a team as a code owner November 2, 2025 16:34

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CyrilleB79

@seanbudd seanbudd merged commit 97f5033 into nvaccess:master Nov 3, 2025
29 checks passed
@github-actions github-actions Bot added this to the 2026.1 milestone Nov 3, 2025
@CyrilleB79 CyrilleB79 deleted the fixCheckPot branch November 3, 2025 19:53
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.

2 participants