1

Topic: Python syntax errors

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9, 1.0-beta1
- Deployed with iRedMail Easy or the downloadable installer? Stand alone
- Linux/BSD distribution name and version: FreeBSD (Any)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL (Any)
- Web server (Apache or Nginx): Nginx (Any)
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

iRedMail-1.0-beta1 $ grep -R " e:" * 
tools/generate_password_hash.py:    except ImportError, e:
tools/ldap_assign_user_to_groups.py:except Exception, e:
tools/ldap_move_members_to_another_group.py:    except Exception, e:
tools/migrate_sql_alias_table.py:except Exception, e:
tools/migrate_sql_alias_table.py:    except Exception, e:
tools/migrate_sql_alias_table.py:            except Exception, e:
tools/migrate_sql_alias_table.py:            except Exception, e:

The correct syntax is:

except Exception as e:

2

Re: Python syntax errors

Fixed moment ago.
But, which version of Python are you running?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Python syntax errors

ZhangHuangbin wrote:

Fixed moment ago.
But, which version of Python are you running?

I started trying to run with Python 3.6.
I then realised I had to use Python 2.7.

But although Python 2.7 accepts the

except Exception, e:

syntax, it does not recommend it, as seen in the documentation, as this syntax is confusing.

So not only Python 3 changed, but Python 2 does not recommend it.

4

Re: Python syntax errors

iRedMail uses Python-2 right now, but we're migrating to Python-3. The "mlmmjadmin" is now py3 only, soon will be iRedAPD, then iRedAdmin-Pro.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee