bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163)

This commit is contained in:
Erlend Egeberg Aasland 2020-11-17 16:55:12 +01:00 committed by GitHub
parent 296a796951
commit a1f401a58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 12 deletions

View file

@ -412,15 +412,6 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
ADD_EXCEPTION(module, "DataError", pysqlite_DataError, pysqlite_DatabaseError);
ADD_EXCEPTION(module, "NotSupportedError", pysqlite_NotSupportedError, pysqlite_DatabaseError);
/* In Python 2.x, setting Connection.text_factory to
OptimizedUnicode caused Unicode objects to be returned for
non-ASCII data and bytestrings to be returned for ASCII data.
Now OptimizedUnicode is an alias for str, so it has no
effect. */
if (PyModule_AddObjectRef(module, "OptimizedUnicode", (PyObject*)&PyUnicode_Type) < 0) {
goto error;
}
/* Set integer constants */
if (add_integer_constants(module) < 0) {
goto error;