keleshev / schema

Schema validation just got Pythonic
MIT License
2.88k stars 215 forks source link

Fix "Unknown format code" in Python 3.8 #245

Closed dblanchette closed 4 years ago

dblanchette commented 4 years ago

On Python 3.8.6, we have started getting this weird error: ValueError: Unknown format code 'b' for object of type 'str'

Turns out there was a change in Python itself so that it is not possible to use a format string with a RegexFlag object anymore.

Casting to int resolves the issue while keeping compatibility with older Python versions.

skorokithakis commented 4 years ago

Thank you!