[PATCH] v1.2 setup.py fails under python 2.3.5

Bug #200569 reported by Jari Aalto
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Jari Aalto

Bug Description

Consider this:

python setup.py install --home $HOME
Traceback (most recent call last):
  File "setup.py", line 12, in ?
    import bzrlib
  File "/mnt/cc/staff-f/jaalto/tmp/compile/bzr-1.2/bzrlib/__init__.py", line 25, in ?
    from bzrlib.osutils import get_user_encoding
  File "/mnt/cc/staff-f/jaalto/tmp/compile/bzr-1.2/bzrlib/osutils.py", line 21
    from stat import (S_ISREG, S_ISDIR, S_ISLNK, ST_MODE, ST_SIZE,
                     ^
SyntaxError: invalid syntax

$ python -V
Python 2.3.5

SUGGESTION

Please apply following patch to next bzr release

--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,10 @@ Run it with
 import os
 import sys

+if sys.hexversion < 0x20400F0:
+ print >>sys.stderr, [ERROR] Not a supported Python version. Need 2.4+
+ sys.exit(1)
+
 import bzrlib

 ##

Revision history for this message
Jari Aalto (jari-aalto) wrote :

Missing quotes; were stripped:

--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,10 @@ Run it with
 import os
 import sys

+if sys.hexversion < 0x20400F0:
+ print >>sys.stderr, "[ERROR] Not a supported Python version. Need 2.4+"
+ sys.exit(1)
+
 import bzrlib

 ##

Revision history for this message
Alexander Belchenko (bialix) wrote :

Please, in the future send patches directly to bazaar ML.

Changed in bzr:
assignee: nobody → jari-aalto
importance: Undecided → Medium
milestone: none → 1.3
status: New → Confirmed
Revision history for this message
Aaron Bentley (abentley) wrote :

Bazaar does not support python2.3, so it's reasonable that its setup utility also does not support python2.3

Changed in bzr:
status: Confirmed → Invalid
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 200569] Re: [PATCH] v1.2 setup.py fails under python 2.3.5

Aaron Bentley пишет:
> Bazaar does not support python2.3, so it's reasonable that its setup
> utility also does not support python2.3

Actually setup.py has code for auto-detection of appropriate verison
of python interpreter. But this check invoked *after* import bzrlib,
and therefore pretty useless.

If you so strong about status of this bug report then we should remove
old supporting code from setup.py as well.

Revision history for this message
Jari Aalto (jari-aalto) wrote :

> Bazaar does not support python2.3, so it's reasonable
> that its setup utility also does not support python2.3

Givinng proper error messages is sign of well contructed program.

The patch only checks proper Python interpreter -- Standard procedure,
similar to what automake scripts do to check that "environment" is ready.

Revision history for this message
John A Meinel (jameinel) wrote :

The only recommendation I would make is that we can use "sys.version_info" instead of sys.hexversion.

We already do this as part of the main "bzr" script:
try:
    version_info = sys.version_info
except AttributeError:
    version_info = 1, 5 # 1.5 or earlier

...
NEED_VERS = (2, 4)

if version_info < NEED_VERS:

I'd be happy enough to bring this into setup.py if it is another main entry point.

I *don't* think we want to use the __REINVOKE logic, since it would be rude to have someone do "python2.3 setup.py install" and have it install on their python2.4 copy.

Revision history for this message
Alexander Belchenko (bialix) wrote :

revno.3268

Changed in bzr:
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.