New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-bb flag gives error re: bytes and strings #147
Comments
Running the test suite on |
Looks like you simply can't have a dict with I'm taking a look if it's practical to remove these occurrences. #122 is related to the content and the use of a database which is not currently supported. |
They were mostly internal ones, coming from dicts containing strings and bytes as keys. Close #147
They were mostly internal ones, coming from dicts containing strings and bytes as keys. Close #147
A fix is on the way. Do you know if there is a practical way to enable running pytest with |
I think that is the only way, although you could add it to the #! of any script, perhaps I looked all over (including the ini files) but have never found out how! Thanks for the rapid fix. |
Thanks for the fix - I confirm that it works now for us with no problem. |
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
The text was updated successfully, but these errors were encountered: