Skip to content

Perform rewrite of format literals containing \N escapes #280

@asottile

Description

@asottile

#279 prevents the crash / incorrect behaviour from #278, but this should be supported -- shouldn't be too difficult but will likely need to reimplement the format string parsing (the stdlib one doesn't notice these escape sequences, probably because they're gone by that point of the parser)

The current behaviours that should be fixed:

  1. % format: '\N{snowman} %s' % (a,) should become '\N{snowman} {}'.format(a)
  2. f-string: '\N{snowman} {}'.format(a) should become f'\N{snowman} {a}'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions