ufw

Comment 10 for bug 953372

Revision history for this message
SÅ‚awomir Nizio (snizio) wrote :

The reason why it's all fine with ufw is it doesn't set up locale*. It gets translated strings but doesn't set the environment which is perfectly fine, I think.

How to test that: if you add these lines to /usr/sbin/ufw:

 24 import locale
 25 locale.setlocale(locale.LC_ALL, '')

then you will get this with LC_ALL=tr_TR.UTF-8 ufw status:
{'Ipt_modules': 'nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns', 'default_applIcatIon_polIcy': 'skIp', 'loglevel': 'low', 'manage_buIltIns': 'no', 'enabled': 'yes', 'default_Input_polIcy': 'drop', 'default_forward_polIcy': 'drop', 'Ipv6': 'yes', 'default_output_polIcy': 'accept'}
ERROR: Missing policy for 'input'

providing that you don't use codecs.open(), but normal open().

What that frontend changes is that it executes ufw code with user's locale and that's why it is OK in ufw but not there.

I guess nothing is to be changed in ufw then. However please keep this in mind in case you want to implement setting locale in ufw at some point.

Thanks for all!

*import locale; locale.getlocale() returns "(None, None)", unlike in that frontend: "('tr_TR', 'UTF-8')" or any