On 06/14/2014 07:30 PM, Evan Carter wrote:
I get different values for sys.getdefaultencoding in Spyder than when I
run the same Python in other ways. It seems that similar behavior was
recently removed from PyDev
<https://sw-brainwy.rhcloud.com/tracker/PyDev/315>.

I'm running Spyder on a Mac. I installed it via Anaconda.

Within Spyder, from a standard Python interpreter accessed via the or
from an iPython console, my default encoding is UTF-8:

    Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Jan 10 2014, 11:23:15)
    [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.

    Imported NumPy 1.7.1, SciPy 0.13.0, Matplotlib 1.3.1
    Type "scientific" for more details.
     >>> import sys
     >>> sys.getdefaultencoding()
    'UTF-8'
     >>>


but when I run what seems to be the same Python from the command prompt,
I get:

    Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Jan 10 2014, 11:23:15)
    [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
     >>> import sys
     >>> sys.getdefaultencoding()
    'ascii'


This caused an error that was fairly difficult to debug. Can I make
Spyder respect the system's default encoding, or otherwise force the two
to be the same?


My guess is it has something to do with this:

http://hints.macworld.com/article.php?story=20100713130450549

So check the environ in each case above to see:

import os
os.environ


--
Adrian Klaver
[email protected]

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to