unable to run "python setup.py install" with Py 2.5 (ubuntu 8.04). Py 2.6 required

Bug #622302 reported by Inaki Fernandez - OpenERPappliance.com
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

I am unable to install openerp-server trunk with today's revisions

+ cd /home/openerp/production/openerp-server
+ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 157, in <module>
    data_files = data_files(),
  File "setup.py", line 93, in data_files
    for addonname, add_path in find_addons():
  File "setup.py", line 55, in find_addons
    for root, _, names in os.walk(join('bin', 'addons'), followlinks=True):
TypeError: walk() got an unexpected keyword argument 'followlinks'

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

Hi,

you have a version of python < 2.6 because followlinks was added in python 2.6

That is however insignificant.

Does this mean that Ver 6 is Py 2.6+ compatible is the more interesting question.

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Hi Sharoon,

Thanks for pointing that out. I am currently running openerp on ubuntu 8.04 LTS (Py 2.5).

If possible, it would be good to make it backwards compatible:

http://docs.python.org/whatsnew/2.6.html : The os.walk() function now has a followlinks parameter. If set to True, it will follow symlinks pointing to directories and visit the directory’s contents. For backward compatibility, the parameter’s default value is false. Note that the function can fall into an infinite recursion if there’s a symlink that points to a parent directory. (issue 1273829)

summary: - unable to run "python setup.py install"
+ unable to run "python setup.py install" with Py 2.5 (ubuntu 8.04). Py
+ 2.6 required
Revision history for this message
Mario Arias (the-clone-master) wrote :

Hi, is there any progress on this?
Will OpenERP be dependant on python 2.6+ from now on??

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Hi there,

Apparently this issue is now fixed in current revisions of openerp-server/setup.py , and hopefully python2.6 is not a requirement from now onwards (to be confirmed):

# backports os.walk with followlinks from python 2.6
def walk_followlinks(top, topdown=True, onerror=None, followlinks=False):
    from os.path import join, isdir, islink
    from os import listdir, error

    try:
        names = listdir(top)
    except error, err:
        if onerror is not None:
            onerror(err)
        return

    dirs, nondirs = [], []
    for name in names:
        if isdir(join(top, name)):
            dirs.append(name)
        else:
            nondirs.append(name)

    if topdown:
        yield top, dirs, nondirs
    for name in dirs:
        path = join(top, name)
        if followlinks or not islink(path):
            for x in walk_followlinks(path, topdown, onerror, followlinks):
                yield x
    if not topdown:
        yield top, dirs, nondirs

if sys.version_info < (2, 6):
    os.walk = walk_followlinks

DIFF FILE BETWEEN OLD FILE AND CURRENT ONE:

diff setup.py /tmp/setup.py
35,36c35,36
< from setuptools import setup, find_packages
< from setuptools.command.install import install
---
> from distutils.core import setup, Command
> from distutils.command.install import install
54,84c54,78
< # backports os.walk with followlinks from python 2.6
< def walk_followlinks(top, topdown=True, onerror=None, followlinks=False):
< from os.path import join, isdir, islink
< from os import listdir, error
<
< try:
< names = listdir(top)
< except error, err:
< if onerror is not None:
< onerror(err)
< return
<
< dirs, nondirs = [], []
< for name in names:
< if isdir(join(top, name)):
< dirs.append(name)
< else:
< nondirs.append(name)
<
< if topdown:
< yield top, dirs, nondirs
< for name in dirs:
< path = join(top, name)
< if followlinks or not islink(path):
< for x in walk_followlinks(path, topdown, onerror, followlinks):
< yield x
< if not topdown:
< yield top, dirs, nondirs
<
< if sys.version_info < (2, 6):
< os.walk = walk_followlinks
---
> required_modules = [
> ('lxml', 'lxml module: pythonic libxml2 and libxslt bindings'),
> ('mako', 'Mako template engine'),
> ('dateutil', "Extensions to the standard datetime module"),
> ('psycopg2', 'PostgreSQL module'),
> ('pychart', 'pychart module'),
> ('pydot', 'pydot module'),
> ('pytz', 'Timezone handling library for Python'),
> ('reportlab', 'reportlab module'),
> ('yaml', 'YAML parser and emitter for Python'),
> ('pywebdav', 'PyWebDAV is a standards compliant WebDAV server and library written in Python'),
> ]

Amit Parik (amit-parik)
Changed in openobject-server:
status: New → Triaged
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello Inaki,

Indeed, this was fixed by revision 2750 <email address hidden> back in september.

Thanks for reporting!

Changed in openobject-server:
importance: Undecided → Medium
milestone: none → 6.0-rc2
status: Triaged → 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.