Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 24EFC200C5B for ; Thu, 27 Apr 2017 11:46:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 23850160BA7; Thu, 27 Apr 2017 09:46:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6ABFD160B98 for ; Thu, 27 Apr 2017 11:46:08 +0200 (CEST) Received: (qmail 73045 invoked by uid 500); 27 Apr 2017 09:46:07 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 73036 invoked by uid 99); 27 Apr 2017 09:46:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2017 09:46:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 27722188AA5 for ; Thu, 27 Apr 2017 09:46:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 2mPg-BOXbnPS for ; Thu, 27 Apr 2017 09:46:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id BB75E5F177 for ; Thu, 27 Apr 2017 09:46:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 62308E0AF9 for ; Thu, 27 Apr 2017 09:46:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1507921DE0 for ; Thu, 27 Apr 2017 09:46:04 +0000 (UTC) Date: Thu, 27 Apr 2017 09:46:04 +0000 (UTC) From: "Gerard Toonstra (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-1144) Logging causes UnicodeEncodeError when using Japanese characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 27 Apr 2017 09:46:09 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15986286#comment-15986286 ] Gerard Toonstra commented on AIRFLOW-1144: ------------------------------------------ Hi Sushant, It sounds like you're mixing encoding settings. The psql client probably outputs in japanese encoding, but airflow expects everything to be in utf-8. You could try to force the client encoding of psql to utf-8 as well: SET client_encoding = 'UTF8'; in a test script first to set the client encoding. If that works, I wouldn't go about to have that at the top of every file, but make this part of your environment. You can add this to either ~/.psqlrc , use an environment variable or let the client figure this out from LC_CTYPE. See the postgres docs for details. Please update this JIRA when you know more. > Logging causes UnicodeEncodeError when using Japanese characters > ---------------------------------------------------------------- > > Key: AIRFLOW-1144 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1144 > Project: Apache Airflow > Issue Type: Bug > Components: logging, worker > Affects Versions: 1.8.0 > Reporter: Sushant Karki > > I am using the bash operator to pipe a sql dump to my database. Since, the encoding of my psql client is Japanese, the output displays some Japanese characters. Whenever the logger tries to log the output, it raises a UnicodeEncodeError. > Here are the details of the error. > {code} > Exception in thread Thread-1: > Traceback (most recent call last): > File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner > self.run() > File "/usr/lib64/python2.7/threading.py", line 766, in run > self.__target(*self.__args, **self.__kwargs) > File "/home/karki/virtualenv/master/local/lib/python2.7/site-packages/airflow/task_runner/base_task_runner.py", line 95, in _read_task_logs > self.logger.info('Subtask: {}'.format(line.rstrip('\n'))) > UnicodeEncodeError: 'ascii' codec can't encode character u'\u884c' in position 58: ordinal not in range(128) > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)