Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-19 Thread Eduardo Habkost
On Tue, Jun 19, 2018 at 01:05:10PM +0100, Daniel P. Berrangé wrote: [...] > > > > The python-future package would help us write code for a single > > > > file/string API instead of two different APIs, but it's not a > > > > QEMU build dependency (yet?), so this patch is good enough for > > > > now.

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-19 Thread Daniel P . Berrangé
On Tue, Jun 19, 2018 at 07:50:32AM -0300, Eduardo Habkost wrote: > On Tue, Jun 19, 2018 at 08:28:08AM +0200, Markus Armbruster wrote: > > Eduardo Habkost writes: > > > > > On Mon, Jun 18, 2018 at 07:59:57PM +0200, Markus Armbruster wrote: > > >> Python 2 happily reads UTF-8 files in text mode, bu

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-19 Thread Markus Armbruster
Eduardo Habkost writes: > On Tue, Jun 19, 2018 at 08:28:08AM +0200, Markus Armbruster wrote: >> Eduardo Habkost writes: >> >> > On Mon, Jun 18, 2018 at 07:59:57PM +0200, Markus Armbruster wrote: >> >> Python 2 happily reads UTF-8 files in text mode, but Python 3 requires >> >> either UTF-8 loca

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-19 Thread Eric Blake
On 06/18/2018 12:59 PM, Markus Armbruster wrote: Python 2 happily reads UTF-8 files in text mode, but Python 3 requires either UTF-8 locale or an explicit encoding passed to open(). Commit d4e5ec877ca fixed this by setting the en_US.UTF-8 locale. Falls apart when the locale isn't be available.

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-19 Thread Eduardo Habkost
On Tue, Jun 19, 2018 at 08:28:08AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Mon, Jun 18, 2018 at 07:59:57PM +0200, Markus Armbruster wrote: > >> Python 2 happily reads UTF-8 files in text mode, but Python 3 requires > >> either UTF-8 locale or an explicit encoding passed

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-18 Thread Markus Armbruster
Eduardo Habkost writes: > On Mon, Jun 18, 2018 at 07:59:57PM +0200, Markus Armbruster wrote: >> Python 2 happily reads UTF-8 files in text mode, but Python 3 requires >> either UTF-8 locale or an explicit encoding passed to open(). Commit >> d4e5ec877ca fixed this by setting the en_US.UTF-8 loca

Re: [Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-18 Thread Eduardo Habkost
On Mon, Jun 18, 2018 at 07:59:57PM +0200, Markus Armbruster wrote: > Python 2 happily reads UTF-8 files in text mode, but Python 3 requires > either UTF-8 locale or an explicit encoding passed to open(). Commit > d4e5ec877ca fixed this by setting the en_US.UTF-8 locale. Falls apart > when the loc

[Qemu-devel] [PATCH v4 1/2] qapi: Open files with encoding='utf-8'

2018-06-18 Thread Markus Armbruster
Python 2 happily reads UTF-8 files in text mode, but Python 3 requires either UTF-8 locale or an explicit encoding passed to open(). Commit d4e5ec877ca fixed this by setting the en_US.UTF-8 locale. Falls apart when the locale isn't be available. Matthias Maier and Arfrever Frehtes Taifersar Arah