noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Unicode environment #487

Open MrYann opened 7 years ago

MrYann commented 7 years ago

Hi :) I try to use build with the build-python extension. This extension claims to execute "python + filename". However, the result is different form what i get when running the same command in the shell. I asked the "build-python" team but they sent me back to the "build" team.

The difference comes from Unicode treatment : 1 - Unicode characters in "filename" are not decoded. Thus, error reports point to a non-existant file (besides looking ugly). 2 - File handling within the python script itself is compromised : when trying to write an unicode character, i have to force utf-8 output, whereas it should be by default on python 3 (meaning the default unicode support is somehow deactivated).

Here is a minimal example :

with open("test.txt", "w") as file: file.write("é")

The "same" problem occurs also using the build-make extension : with a python command in the makefile, that python command has unicode issues (which do not happen when the command is run in the terminal)

For reference, i use a mac with latest macOS and have python 3.5.2, anaconda distribution.

EDIT : this is not a "build" package issue, since I encounter the same problem with the "script" package. So my guess is it is an atom issue. However, if anyone has a solution I will be glad to hear it :)