Python icon indicating copy to clipboard operation
Python copied to clipboard

Invalid utf characters in linux

Open csoriano1618 opened this issue 11 years ago • 3 comments

This is the error when trying to execute a file in Linux that has been made in Linux. Traceback (most recent call last): File "/opt/LightTable/plugins/python/py-src/ltmain.py", line 191, in handleEval code= compile(code, data[2]["name"], 'exec') UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-12: ordinal not in range(128) screenshot from 2014-02-01 02 46 57

csoriano1618 avatar Feb 01 '14 01:02 csoriano1618

I have exactly same issue in Windows7. Folder where the file opened is contains python files with unicode characters. All files were made in windows. I cant see this bug when I open file and trying to evaluate it (just nothing works), but if I add python connection to the folder with my project and then try to evaluate my file (without unicode characters in itself, only in other files in folder) I am getting exactly same error.

flashus avatar Jul 14 '14 03:07 flashus

Same problem here; working on Ubuntu 14.04, fresh install of latest LightTable as of 14 Jan 2015 (LightTable version 0.7.2, binary version 0.8.6).

SuperElectric avatar Jan 14 '15 13:01 SuperElectric

I have the same problem here, but I have something that seems to be a workaround. Adding one of the following the the first or second line of the Python code (depending on the encoding used) seems to work for me:

# -*- coding: ascii -*-

OR

# -*- coding: utf-8 -*-

Based on: https://www.python.org/dev/peps/pep-0263/

nathanielng avatar Mar 16 '15 14:03 nathanielng