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 D5F72200CD4 for ; Sat, 29 Jul 2017 13:03:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D45C9168667; Sat, 29 Jul 2017 11:03:04 +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 F423C168657 for ; Sat, 29 Jul 2017 13:03:03 +0200 (CEST) Received: (qmail 99544 invoked by uid 500); 29 Jul 2017 11:03:03 -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 99535 invoked by uid 99); 29 Jul 2017 11:03:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jul 2017 11:03:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B1C621A1ABD for ; Sat, 29 Jul 2017 11:03:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.702 X-Spam-Level: X-Spam-Status: No, score=-98.702 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id vN33YzfjkJ7u for ; Sat, 29 Jul 2017 11:03:01 +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 101005F242 for ; Sat, 29 Jul 2017 11:03:01 +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 716C7E02C7 for ; Sat, 29 Jul 2017 11:03:00 +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 2020A2464C for ; Sat, 29 Jul 2017 11:03:00 +0000 (UTC) Date: Sat, 29 Jul 2017 11:03:00 +0000 (UTC) From: "Ace Haidrey (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (AIRFLOW-1239) base_task_runner logging with unicode values on Py27 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 29 Jul 2017 11:03:05 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-1239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16106097#comment-16106097 ] Ace Haidrey edited comment on AIRFLOW-1239 at 7/29/17 11:02 AM: ---------------------------------------------------------------- Added the below to pr: https://github.com/apache/incubator-airflow/pull/2318 Agree with @AllisonWang comments. I am having these same error messages looking like the following: {code} [2017-07-28 23:03:03,358] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "/home/ahaidrey/.virtualenvs/airflow/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'\u2018' in position 66: ordinal not in range(128) {code} But after adding the line {{from __future__ import unicode_literals}} (like Allison's suggestion) it goes away and I have something like the following in my worker logs: {code} [2017-07-29 03:57:05,707] {__init__.py:57} INFO - Using executor CeleryExecutor [2017-07-29 03:57:05,833] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt [2017-07-29 03:57:05,879] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt {code} I read this [SO post|https://stackoverflow.com/questions/3235386/python-using-format-on-a-unicode-escaped-string] to get that solution. was (Author: ahaidrey): Added the below to pr: https://github.com/apache/incubator-airflow/pull/2318 Agree with @AllisonWang comments. I am having these same error messages looking like the following: {code} [2017-07-28 23:03:03,358] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "/home/ahaidrey/.virtualenvs/airflow/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'\u2018' in position 66: ordinal not in range(128) {code} But after adding the line `from __future__ import unicode_literals` (like Allison's suggestion) it goes away and I have something like the following in my worker logs: {code} [2017-07-29 03:57:05,707] {__init__.py:57} INFO - Using executor CeleryExecutor [2017-07-29 03:57:05,833] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt [2017-07-29 03:57:05,879] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt {code} I read this [SO post|https://stackoverflow.com/questions/3235386/python-using-format-on-a-unicode-escaped-string] to get that solution. > base_task_runner logging with unicode values on Py27 > ---------------------------------------------------- > > Key: AIRFLOW-1239 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1239 > Project: Apache Airflow > Issue Type: Bug > Components: worker > Reporter: yanghanbing > > Exception in thread Thread-1: > Traceback (most recent call last): > File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner > self.run() > File "/usr/lib64/python2.7/threading.py", line 764, in run > self.__target(*self.__args, **self.__kwargs) > File "/opt/cloudera-manager/cm-5.5.1/run/cloudera-scm-server/airflow/env/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 characters in position 107-108: ordinal not in range(128) -- This message was sent by Atlassian JIRA (v6.4.14#64029)