Skip to content

Docs: empty smart_truncate separator raises only on the word-boundary path - #217

Merged
un33k merged 2 commits into
masterfrom
fix/smart-truncate-empty-separator-doc
Nov 29, 2026
Merged

un33k merged 2 commits into
masterfrom
fix/smart-truncate-empty-separator-doc

Conversation

@un33k

@un33k un33k commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Docs only, no behavior change, no release (ships with the next one).

The README and the legacy smart_truncate docstring said empty separators raise ValueError. They only do on the word-boundary path (word_boundary=True and the string at least max_length long); otherwise an empty separator is a plain cut, e.g. smart_truncate('aaa bbb', 3, False, '') returns 'aaa'.

  • README and slugify/_legacy.py docstring corrected (comment-only change to the frozen module; legacy output verified unchanged with tools/check_algorithms.py).
  • tests/test_release.py pins the non-raising cases next to the existing raising one.
  • CHANGELOG: entry under Unreleased.

Checks: 140 passed, 5 skipped; algorithm API goldens PASS; pycodestyle, flake8 and mypy clean.

Reported by Arden by email.

Closes #218.

🚀 Generated with Dojo ⛩️

@un33k
un33k merged commit 061663b into master Nov 29, 2026
1 check passed
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.723%. remained the same — fix/smart-truncate-empty-separator-doc into master

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.

Docs: empty smart_truncate separator raises ValueError only on the word-boundary path

2 participants