mike watkins dot ca : Python 3 System Side Effects

Python 3 System Side Effects

Heads up to package maintainers and Unix/Linux users: Depending on your system's package system you may run into problems like this build problem on FreeBSD, should you make Python 3 your base install of Python:

$ portmaster -B firefox3
 |snip|
 /usr/local/bin/python ../toolkit/xre/make-platformini.py --print-buildid > buildid
   File "../toolkit/xre/make-platformini.py", line 15
     print datetime.now().strftime('%Y%m%d%H')
                  ^
 SyntaxError: invalid syntax
 gmake[3]: *** [export] Error 1
 gmake[3]: Leaving directory `/usr/ports/www/firefox3/work/mozilla/config'
 gmake[2]: *** [export_tier_base] Error 2
 gmake[2]: Leaving directory `/usr/ports/www/firefox3/work/mozilla'
 gmake[1]: *** [tier_base] Error 2
 gmake[1]: Leaving directory `/usr/ports/www/firefox3/work/mozilla'
 gmake: *** [default] Error 2
 *** Error code 2

 Stop in /usr/ports/www/firefox3.
 *** Error code 1

I must admit I'd not thought of FreeBSD's ports system as being vulnerable to Python 3 changes, but of course "scripting" languages like Python (and Ruby and Perl and ...) are heavily used by thousands of package distributions.

The simple fix: Keep the 2.x line of Python on yours systems... ../bin/python will just have to point to 2.x for the time being.