Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Printables does not contain replacement character #392

@davetapley

Description

@davetapley

Here's a awkward one that just cost me a lot of time 😞

I'm using this pattern to skip over lines I don't care about:

knownLines = # some parser
otherStuff = Suppress(Word(printables))
parser = OneOrMore(knownLines | otherStuff)

It wasn't working for some inputs which come from web requests.
Turns out those inputs include one or more �, aka REPLACEMENT CHARACTER,
and since that isn't in printables the whole thing broke down.


I can work around it with:

otherStuff = Suppress(Word(printables) | Char('�'))

But is there any chance you'd consider adding � to printables?

printables = "".join([c for c in string.printable if c not in string.whitespace])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions