[IPython-dev] String encoding

Brian Granger ellisonbg at gmail.com
Fri Jun 17 13:08:04 EDT 2011

On Fri, Jun 17, 2011 at 3:24 AM, Thomas Kluyver <takowl at gmail.com> wrote:
> On 17 June 2011 07:39, Fernando Perez <fperez.net at gmail.com> wrote:
>> I guess we could make it a configurable option, but I'm not even sure
>> it's worth the added complexity, so I'm mildly -1 on going down that
>> road, unless I can be convinced that the implementation isn't that
>> complicated and that there's really a *major* usability win for
>> certain users for whom the default is just too annoying to bear.
> The complexity in terms of code is fairly minimal - a boolean config
> variable, and an if/else inside run_cell should cover it. The main downside
> would be the added load on testing and maintenance - if the variable became
> widely used, any bug report relating to unicode would leave us asking which
> way the user had it set.
> I'll leave it to Jörgen to put the case for usability.
> In fact, I've just worked out a way round the issue, although it's not
> pretty. If we were to encode each cell, and prepend the "# coding: <enc>"
> magic comment before parsing it, it seems to work. However, the line numbers
> within the cell are then out by 1 (i.e. if you see a traceback). As far as I
> can tell, there's no way to store this state between compile/parse calls -
> codeop.Compile doesn't remember it. I don't much like the idea of doing
> this, though.

This sounds too complex.  I would say let's just go with (1).



> Thanks,
> Thomas
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com

More information about the IPython-dev mailing list