classification
Title: setup.py crashes if sqlite version contains 'beta'
Type: compile error Stage: resolved
Components: Build Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Andreas.Pelme, BreamoreBoy, blahblahwhat, eric.araujo, ghaering, petri.lehtinen, python-dev, tarek
Priority: low Keywords: easy, patch

Created on 2009-01-22 16:23 by blahblahwhat, last changed 2013-02-23 16:29 by petri.lehtinen. This issue is now closed.

Files
File name Uploaded Description Edit
issue5033.patch Andreas.Pelme, 2013-02-23 14:53 review
Messages (6)
msg80370 - (view) Author: blahblahwhat (blahblahwhat) Date: 2009-01-22 16:23
When I try to 'make' Python 2.6.1:

Traceback (most recent call last):
  File "./setup.py", line 1880, in <module>
    main()
  File "./setup.py", line 1875, in main
    'Lib/smtpd.py']
  File "/home/apps/Python-2.6.1/Lib/distutils/core.py", line 152, in 
setup
    dist.run_commands()
  File "/home/apps/Python-2.6.1/Lib/distutils/dist.py", line 975, in 
run_commands
    self.run_command(cmd)
  File "/home/apps/Python-2.6.1/Lib/distutils/dist.py", line 995, in 
run_command
    cmd_obj.run()
  File "/home/apps/Python-2.6.1/Lib/distutils/command/build.py", line 
134, in run
    self.run_command(cmd_name)
  File "/home/apps/Python-2.6.1/Lib/distutils/cmd.py", line 333, in 
run_command
    self.distribution.run_command(command)
  File "/home/apps/Python-2.6.1/Lib/distutils/dist.py", line 995, in 
run_command
    cmd_obj.run()
  File "/home/apps/Python-2.6.1/Lib/distutils/command/build_ext.py", 
line 343, in run
    self.build_extensions()
  File "./setup.py", line 103, in build_extensions
    missing = self.detect_modules()
  File "./setup.py", line 915, in detect_modules
    for x in sqlite_version.split(".")])
ValueError: invalid literal for int() with base 10: '1beta'

This was solved by replacing

  m = re.search(r'\s*.*#\s*.*define\s.*SQLITE_VERSION\W*"(.*)"', incf)

with

  m = re.search(r'\s*.*#\s*.*define\s.*SQLITE_VERSION\W*"([\d\.]*)"', 
incf)

on line 911
msg116570 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-16 16:17
A one line fix is given in msg80370, can this be applied,should the issue be closed or what?
msg121413 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-18 02:02
The regex is still the same.  I’ll try changing the version string in sqlite and trigger the bug.
msg182748 - (view) Author: Andreas Pelme (Andreas.Pelme) * Date: 2013-02-23 14:53
This bug still exists in 2.7 and 3.4.

If SQLITE_VERSION in sqlite3.h (/usr/include/sqlite3.h on Mac OS) ends with beta, such as
 
#define SQLITE_VERSION        "3.7.12beta"

make will fail.

The regex changed suggested above fixes this. The attached patch contains that fix and makes the build work.
msg182756 - (view) Author: Roundup Robot (python-dev) Date: 2013-02-23 16:28
New changeset 8b177aea9ddd by Petri Lehtinen in branch '2.7':
Issue #5033: Fix building of the sqlite3 extension module
http://hg.python.org/cpython/rev/8b177aea9ddd

New changeset 73d5dd480558 by Petri Lehtinen in branch '3.2':
Issue #5033: Fix building of the sqlite3 extension module
http://hg.python.org/cpython/rev/73d5dd480558

New changeset c613eb716c8e by Petri Lehtinen in branch '3.3':
Issue #5033: Fix building of the sqlite3 extension module
http://hg.python.org/cpython/rev/c613eb716c8e

New changeset 19b3aaf79e45 by Petri Lehtinen in branch 'default':
Issue #5033: Fix building of the sqlite3 extension module
http://hg.python.org/cpython/rev/19b3aaf79e45
msg182757 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2013-02-23 16:29
Applied, thanks!
History
Date User Action Args
2013-02-23 16:29:20petri.lehtinensetstatus: open -> closed

nosy: + petri.lehtinen
messages: + msg182757

resolution: fixed
stage: patch review -> resolved
2013-02-23 16:28:34python-devsetnosy: + python-dev
messages: + msg182756
2013-02-23 14:53:29Andreas.Pelmesetfiles: + issue5033.patch

nosy: + Andreas.Pelme
messages: + msg182748

keywords: + patch
2013-02-23 12:59:56pitrousetstage: needs patch -> patch review
2013-02-23 06:53:08ezio.melottisetkeywords: + easy
stage: needs patch
versions: + Python 3.3, Python 3.4, - Python 3.1
2010-11-18 02:02:28eric.araujosetnosy: + tarek, eric.araujo
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
messages: + msg121413

assignee: ghaering ->
2010-09-16 16:17:19BreamoreBoysetnosy: + BreamoreBoy
messages: + msg116570
2009-03-20 11:20:27ghaeringsetpriority: low
assignee: ghaering

nosy: + ghaering
2009-01-22 16:23:25blahblahwhatcreate