I just updated web2py to the trunk version on a server running Python 2.4.4 
and it immediately crashed with an error because of the try/except/finally 
usage in the new custom_import.py file. This is easy to fix though. Instead 
of using:

try:
    # code
except:
    # code
finally:
   # code

You would simply use:

try:
    try:
        # code
    except:
        # code
finally:
    # code

I have made this change in custom_import.py (lines 83 - 102), however, I ran 
into another problem which I can't figure out:

File "/opt/spsa/web2py/gluon/widget.py", line 24, in ?
    import main
  File "/opt/spsa/web2py/gluon/main.py", line 65, in ?
    custom_import_install(web2py_path)
  File "/opt/spsa/web2py/gluon/custom_import.py", line 15, in 
custom_import_install
    _Web2pyDateTrackerImporter(web2py_path)
  File "/opt/spsa/web2py/gluon/custom_import.py", line 200, in __init__
    self.__RE_APP_DIR = re.compile(
  File "/opt/spsa/python/lib/python2.4/sre.py", line 180, in compile
    return _compile(pattern, flags)
  File "/opt/spsa/python/lib/python2.4/sre.py", line 225, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/opt/spsa/python/lib/python2.4/sre_compile.py", line 494, in compile
    import sre_parse
  File "/opt/spsa/web2py/gluon/custom_import.py", line 254, in __call__
    fromlist, level)
  File "/opt/spsa/web2py/gluon/custom_import.py", line 99, in __call__
    raise e  # Don't hide something that went wrong
TypeError: __import__() takes at most 4 arguments (5 given)

I'm not sure what to do here. Anyone have any thoughts?

P.S. Python 2.4.4 is a requirement for me, so upgrading to 2.5 is not an 
option right now.

Reply via email to