# Make textwrap reject nonsensical indent/width combinations

**URL:** <https://discuss.python.org/t/make-textwrap-reject-nonsensical-indent-width-combinations/110404>\
**Category:** Ideas\
**Created:** [December 1, 2026, 5:07pm UTC](https://discuss.python.org/t/make-textwrap-reject-nonsensical-indent-width-combinations/110404 "2026-12-01T17:07:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirosen](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sirosen/32/8478_2.png) [@sirosen](https://discuss.python.org/u/sirosen)\
**Post date:** [December 1, 2026, 5:07pm UTC](https://discuss.python.org/t/make-textwrap-reject-nonsensical-indent-width-combinations/110404/1 "2026-12-01T17:07:47Z")

</div>

I was looking at some of the open PRs for `textwrap`, and there are some cases in which the caller’s request can’t be satisfied.

For example, an indent which can’t fit in the width:

```python
>>> textwrap.wrap("abcdef", width=2, subsequent_indent=" ")
['ab', ' c', ' d', ' e', ' f']

```

I find that result to be _wrong_ but there is no possible correct result.

This can also produce strange behavior, including [a hang if you use whitespace in the right way](https://github.com/python/cpython/issues/158979).

If you do certain _other_ nonsensical things, you get a `ValueError`:

```python
>>> textwrap.wrap("abcdef", width=1, max_lines=2)
... # traceback
ValueError: placeholder too large for max width

```

I think at a minimum we should make it an error to give an indent too big for the width. Does anyone find that change objectionable? Maybe there are other cases like this which should become more strict in `textwrap`?
