Skip to content

-bb flag gives error re: bytes and strings #147

@rojalator

Description

@rojalator

We run our code with the python -bb flag to issue errors about string / byte comparisons. Doing so with psycopg3 results in:

python3.9/site-packages/psycopg/_encodings.py", line 64, in <module> py_codecs.update((k.encode(), v) for k, v in _py_codecs.items())
This was not the case with psycopg2 (we are in the process of moving to psycopg3 from psycopg2)
Obviously our workaround is to just use -b (or none at all) - I note though, that #122 also indicates a UNICODE error so perhaps _encodings.py requires a bit more work.

Python 3.9
psycopg 3.0.3

Metadata

Metadata

Assignees

No one assigned

    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