[問題] systemd python stdout encode變成ANSI
在嘗試用systemd來掛載python3 script
碰到systemd會使python3 sys.stdout.encode變成ANSI
當有中文的時候就會出現fail
請問是否可以讓sys.stdout.encode保持utf-8?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.171.160.122
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1511708343.A.8B8.html
※ walelile:轉錄至看板 Python 11/26 23:26
→
11/27 00:08,
8年前
, 1F
11/27 00:08, 1F
請問這個要加在哪邊?
之前有把 PYTHONPATH 加在/etc/bash.bashrc
但systemd似乎不吃這個
Python版有前輩提到可能是systemd session沒辦法正確吃到語言的環境設定
git上有相關的的bug,但目前已經沒辦法再花時間看了...
※ 編輯: walelile (1.171.160.122), 11/27/2017 00:17:49
※ 編輯: walelile (1.171.160.122), 11/27/2017 00:21:10
→
11/27 00:40,
8年前
, 2F
11/27 00:40, 2F
→
11/27 02:21,
8年前
, 3F
11/27 02:21, 3F
Linux 近期熱門文章
21
56
PTT數位生活區 即時熱門文章