Skip to content

Center alignment / stripping in 1.17 incompatible with 1.16 #118

@catcaf

Description

@catcaf

parse 1.16

>>> import parse
>>> parse.parse("Column{:d}:{:^}", "Column 1: Timestep")
<Result (1, 'Timestep') {}>
>>> parse.parse("Column {:d}:{:^}", "Column 1: Timestep")
<Result (1, 'Timestep') {}>

parse 1.17

>>> import parse
>>> parse.parse("Column{:d}:{:^}", "Column 1: Timestep")
>>> parse.parse("Column {:d}:{:^}", "Column 1: Timestep")

The above 2 lines does not return any matches.
When removing the center alignment it gives a result, but unstripped:

>>> parse.parse("Column{:d}:{}", "Column 1: Timestep")
<Result (1, ' Timestep') {}>
>>> parse.parse("Column {:d}:{}", "Column 1: Timestep")
<Result (1, ' Timestep') {}>

If the input string has an ending whitespace, the alignment operator works:

>>> parse.parse("Column {:d}:{:^}", "Column 1: Timestep ")
<Result (1, 'Timestep') {}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions