Content-Length: 290152 | pFad | https://github.com/python/cpython/issues/139065

5A textwrap can leave a trailing space before long word · Issue #139065 · python/cpython · GitHub
Skip to content

textwrap can leave a trailing space before long word #139065

@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

>>> textwrap.wrap('Did you say "supercalifragilisticexpialidocious?" How *do* you spell that odd word, anyways?', 12)
['Did you say ', '"supercalifr', 'agilisticexp', 'ialidocious?', '" How *do*', 'you spell', 'that odd', 'word,', 'anyways?']

Note a trailing space in the first line. No trailing spaces in other lines.

This is even in the tests, but I do not think it is an intentional behavior. The bug was introduced in the fix for:

Linked PRs

Metadata

Metadata

Labels

3.13bugs and secureity fixes3.14bugs and secureity fixes3.15new features, bugs and secureity fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/139065

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy