Hello, Am Mittwoch, 8. Oktober 2014 schrieb Claudio Freire:
On Wed, Oct 8, 2014 at 4:50 PM, Christian Boltz wrote:
+ self.LOG = open(self.filename, 'r', errors='surrogateescape')
This is probably not the final patch (it breaks compability with python2, which we keep upstream), but it should work ;-)
You should open the file in binary mode if you expect byte strings
In theory you are right. In practise, this opens another can of worms because python3 errors out if you for example compare the content of a "binary" variable (containing only ASCII text) with some non-binary ASCII text. I already had some "fun" with this... ;-) With python2, this "just worked" - but I'd like to avoid using the old version unless really needed. [insert rant about incompatible changes between python versions here] That said - the log lines that are relevant for AppArmor are guaranteed to be ASCII (filenames with non-ASCII characters are encoded in the log), which means the patch only modifies lines that are read and instantly thrown away ;-) Regards, Christian Boltz --
IIRC gab es ÜHER mal so seltsame rechteckige Blöcke mit vielen einzelnen Blättern aus Zellulosefasern in denen man Rezepte nachlesen konnte... aber frag' mich jetzt nur nicht, wie die hießen. Du redest doch wohl nicht von ermordeten Bäumen? [>T. Braun und S. Posner]
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org