Python 3 str() is a unicode already, so can't be decoded.
subprocess.Popen needs to be in text mode (universal_newlines is the
oldest compatible kwarg for this) in order to do line-based buffering.
In general, all the filesystem encoding stuff we were doing is done by
Python itself now.
This is really easier and much more portable (Mac OS 10.5 and later)
than the other solution proposed. The problem with the actual code happens
when I set English as my main language with a French localisation and
keyboard. Sometimes, the AppleLanguages configuration file contains names
like "English" instead of "en", "EN" or "en_EN". Moreover, there can be
more than one language defined here. Instead, I suggest with this PR to
use AppleLocale directly, which is in the "en_EN" format (or whatever
language) and is set to the current language used by the machine. This
would allow users to just launch Zenmap and have the software launched in
the desired language without having to use the terminal (they can still
change their machine language in the System Preferences or via the
Terminal, but it would be easier to use).
This file is automatically copied into the bundle by py2app. It is
already present as a system library on OS X 10.6 and later. Shipping our
own caused a compatibility problem on OS X 10.9:
Could not import the zenmapGUI.App module: 'dlopen(/Applications/Zenmap.app/Contents/Resources/lib/python2.6/lib-dynload/glib/_glib.so, 2): Symbol not found: _xmlBufContent\n Referenced from: /usr/lib/libxslt.1.dylib\n Expected in: /Applications/Zenmap.app/Contents/Frameworks/libxml2.2.dylib\n in /usr/lib/libxslt.1.dylib'.
http://seclists.org/nmap-dev/2013/q4/85
for file in `grep "* including the terms and conditions of this license text as well. \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well. \*/* including the terms and conditions of this license text as well. */g" -i $file; done