[issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported.

2020-01-21 Thread Igor Ceh


New submission from Igor Ceh :

While trying to build Python 3.8.1 from source with Sqlite 3.30.1 on a CentOS 
6.10 I get the following warning:

*** WARNING: renaming "_sqlite3" since importing it failed: 
build/lib.linux-x86_64-3.8/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined 
symbol: sqlite3_close_v2

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time


Failed to build these modules:
_uuid


Following modules built successfully but were removed because they could not be 
imported:
_sqlite3

If I try to import sqlite in python:
[vagrant@centos6 Python-3.8.1]$ ./python
Python 3.8.1 (default, Jan 21 2020, 04:22:59)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/src/Python-3.8.1/Lib/sqlite3/__init__.py", line 23, in 

from sqlite3.dbapi2 import *
  File "/usr/local/src/Python-3.8.1/Lib/sqlite3/dbapi2.py", line 27, in 
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
>>>

Also tried building with SQLite version 3.7.9 from atomic repository with same 
error.

--
messages: 360395
nosy: cehovski
priority: normal
severity: normal
status: open
title: CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed 
because it cannot be imported.
type: compile error
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue39410>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported.

2020-01-21 Thread Igor Ceh


Igor Ceh  added the comment:

I've changed ./Modules/_sqlite/util.h

//#if SQLITE_VERSION_NUMBER >= 3007014
#if SQLITE_VERSION_NUMBER >= 3107014 // Change
#define SQLITE3_CLOSE sqlite3_close_v2
#else
#define SQLITE3_CLOSE sqlite3_close
#endif

#endif

And tried to recompile with a new error:
*** WARNING: renaming "_sqlite3" since importing it failed: 
build/lib.linux-x86_64-3.8/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined 
symbol: sqlite3_errstr  



The following modules found by detect_modules() in setup.py, 
have been   

built by the Makefile instead, as configured by the Setup 
files:  

   _abc  atexitpwd
time


Failed to build these modules:
_uuid


Following modules built successfully but were removed because they could not be 
imported:
_sqlite3

Went into ./Modules/_sqlite/connection.c and also changed:
//#if SQLITE_VERSION_NUMBER > 3007015
#if SQLITE_VERSION_NUMBER > 3107015 // Change   


   PyErr_SetString(pysqlite_OperationalError, 
sqlite3_errstr(rc));

With these changes the build was successful and I can import sqlite3. But I 
have no idea if this has any unforeseen consequences.

--

___
Python tracker 
<https://bugs.python.org/issue39410>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com