[IPython-User] 0.11: sys.argv is now unicode
Wed Aug 10 15:40:32 CDT 2011
On Wed, Aug 10, 2011 at 13:30, John Reid <firstname.lastname@example.org>wrote:
> On 10/08/11 21:25, MinRK wrote:
> > On Wed, Aug 10, 2011 at 07:39, John Reid <email@example.com
> > <mailto:firstname.lastname@example.org>> wrote:
> > Hi,
> > I've switched to 0.11 recently and am very happy with it. One thing I
> > did notice is that all of sys.argv is now unicode. Is there any way
> > get back to the old behaviour where sys.argv was string?
> > We have found things to be better behaved when argv is decoded. You
> > can, of course, encode it right back to bytes with:
> > sys.argv = [ a.encode(sys.stdin.encoding or 'ascii') for a in sys.argv ]
> OK I will try that. I've no doubt unicode is better in general than
> ascii but in my case it broke most of my scripts as they interface to
> C++ libraries that expected ascii. So just to make sure: there's no
> option in ipython to revert the behaviour and no plans to introduce one?
None that I know of. If this does cause problems, we might do something
like put our unicode args in sys.argvu, without fixing sys.argv.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User