Re: [Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-08-07 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:46) > We're trying to write a unicode string (i.e decoded) to a file opened > in binary (i.e encoded) mode. > > In Python 2 this works, because of the automatic conversion between > byte and unicode strings. > > In Python 3 this

Re: [Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-08-07 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-06 02:34:56) > On Thu, 2018-07-05 at 09:14 -0700, Dylan Baker wrote: > > Does it make more sense to encode, or to use io.open and open the > > file in text mode? I've gone back and forth on this myself several > > times. > > Same here, both seem equally valid and I

Re: [Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-07-06 Thread Mathieu Bridon
On Thu, 2018-07-05 at 09:14 -0700, Dylan Baker wrote: > Does it make more sense to encode, or to use io.open and open the > file in text mode? I've gone back and forth on this myself several > times. Same here, both seem equally valid and I can't really make my mind up on which one to pick. The g

Re: [Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-07-05 Thread Dylan Baker
Does it make more sense to encode, or to use io.open and open the file in text mode? I've gone back and forth on this myself several times. Quoting Mathieu Bridon (2018-07-05 06:17:46) > We're trying to write a unicode string (i.e decoded) to a file opened > in binary (i.e encoded) mode. > > In P

[Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-07-05 Thread Mathieu Bridon
We're trying to write a unicode string (i.e decoded) to a file opened in binary (i.e encoded) mode. In Python 2 this works, because of the automatic conversion between byte and unicode strings. In Python 3 this fails though, as no automatic conversion is attempted. This change makes the scripts