Skip to content

OCTO-11227 #376

Merged
OlteanuRares merged 3 commits into
mainfrom
OCTO-11227
Jun 25, 2026
Merged

OCTO-11227 #376
OlteanuRares merged 3 commits into
mainfrom
OCTO-11227

Conversation

@OlteanuRares

Copy link
Copy Markdown
Contributor

SCC files double every control code for error correction. So 9120 (italic off / white plain) is always sent as 9120 9120. The decoder sees the pair and ignores the second one.

When pycaption processes a mid-row code like 9120, it looks at the next word in the hex stream to decide whether to insert a space. If the next word starts with a punctuation byte (ae = period, a1 = exclamation, etc.), it skips the space.

In the failing file, the sequence is:

...9120 9120 ae80...
↑ ↑
duplicate period

When processing the first 9120:

next_command = "9120" (the duplicate)

next_command[:2] = "91" — NOT punctuation

Space gets inserted → "Files ." → 33 chars → error

The Fix

If the next word is identical to the current word (it's the duplicate), skip it and look one further. Now when processing the first 9120:

Sees word_list[idx+1] = "9120" = same as current word → skip

next_command = "ae80" (the period)

next_command[:2] = "ae" — IS punctuation

Space is suppressed → "Files." → 32 chars → passes

…tuation

  The punctuation lookahead that suppresses mid-row code spaces was
  seeing the SCC error-correction duplicate instead of the actual next
  content. When a doubled control code (e.g. 9120 9120) appeared before
  punctuation (e.g. ae80 = period), the duplicate masked the period from
  the check, causing an incorrect space to be inserted and pushing the
  line to 33 characters.

  Skip the duplicate when computing next_command so the punctuation
  exception works as intended.
@OlteanuRares OlteanuRares requested a review from a team as a code owner June 25, 2026 12:15
@github-actions

Copy link
Copy Markdown

🟢 PR Compliance Review

Risk Level: LOW

  • Compliance Issues: 0 (0 critical)
  • Regressions: 0

SAFE TO MERGE - No critical issues found

Full report available in workflow artifacts

@github-actions

Copy link
Copy Markdown

🟢 PR Compliance Review

Risk Level: LOW

  • Compliance Issues: 0 (0 critical)
  • Regressions: 0

SAFE TO MERGE - No critical issues found

Full report available in workflow artifacts

dianadersedan
dianadersedan previously approved these changes Jun 25, 2026
@github-actions

Copy link
Copy Markdown

🟢 PR Compliance Review

Risk Level: LOW

  • Compliance Issues: 0 (0 critical)
  • Regressions: 0

SAFE TO MERGE - No critical issues found

Full report available in workflow artifacts

@OlteanuRares OlteanuRares merged commit b17aec7 into main Jun 25, 2026
4 checks passed
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