-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Encoding question: SystemError: 'cp1252', Python 3.5, psycopg2 '2.6.1 (dt dec pq3 ext lo64)' #442
Comments
In what language is this postgres installation? |
English on Windows 10 On Thu, Jul 7, 2016 at 7:19 AM, Daniele Varrazzo [email protected]
|
The above causes an error because "create database if not exists" doesn't exist.
I believe this message gets localized in a locale that has chars not supported in cp1252, which postgres emits anyway but python then barfs trying to decode, in a codepath that doesn't handle the exception properly. I should make myself a Japanese database to play with... However if you say that postgres is in English for you, then my theory doesn't work here because, as you see above there is no problem receiving the exception in English. |
@dvarrazzo I think it's the other way around, python is in cp1252, postgres is in utf8. |
Is there an explicit encoding requirement that I need to set? Thanks
cur.execute("""CREATE DATABASE IF NOT EXISTS TEST""")
*** SystemError: decoding with 'cp1252' codec failed (SystemError: returned a result with an error set)
The text was updated successfully, but these errors were encountered: