Skip to content

Remove trailing whitespace or remove all whitespaces on both sides? #181

Description

@baldassarreFe

This line doesn't do what the comment says:

natsort/natsort/__main__.py

Lines 180 to 181 in dc1edbb

# Remove trailing whitespace from all the entries
entries = [e.strip() for e in args.entries]

As it is now, it will remove all whitespaces on both sides of the string. Should it only remove the trailing one (str.rstrip())? Should it remove only one character or all whitespaces?

Example:

python -m natsort 'tmp/a57/path2 ' '  tmp/a23/path1' ' tmp/a1/path1'
tmp/a1/path1
tmp/a23/path1
tmp/a57/path2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions