Re: [RFC/PATCH 2/8 v3] git_remote_helpers: fix input when running under Python 3

2013-01-16 Thread Pete Wyckoff
j...@keeping.me.uk wrote on Wed, 16 Jan 2013 09:45 +: > On Tue, Jan 15, 2013 at 07:03:16PM -0500, Pete Wyckoff wrote: > > I'd suggest for this Python conundrum using byte-string literals, e.g.: > > > > lines = check_output(args).strip().split(b'\n') > > value, name = line.split(b'

Re: [RFC/PATCH 2/8 v3] git_remote_helpers: fix input when running under Python 3

2013-01-16 Thread John Keeping
On Tue, Jan 15, 2013 at 07:03:16PM -0500, Pete Wyckoff wrote: > j...@keeping.me.uk wrote on Tue, 15 Jan 2013 22:40 +: >> This is what keeping the refs as byte strings looks like. > > As John knows, it is not possible to interpret text from a byte > string without talking about the character en

Re: [RFC/PATCH 2/8 v3] git_remote_helpers: fix input when running under Python 3

2013-01-15 Thread Pete Wyckoff
j...@keeping.me.uk wrote on Tue, 15 Jan 2013 22:40 +: > This is what keeping the refs as byte strings looks like. As John knows, it is not possible to interpret text from a byte string without talking about the character encoding. Git is (largely) a C program and uses the character set define

[RFC/PATCH 2/8 v3] git_remote_helpers: fix input when running under Python 3

2013-01-15 Thread John Keeping
Although 2to3 will fix most issues in Python 2 code to make it run under Python 3, it does not handle the new strict separation between byte strings and unicode strings. There is one instance in git_remote_helpers where we are caught by this, which is when reading refs from "git for-each-ref". Fi