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 529E2200BF3 for ; Thu, 5 Jan 2017 22:52:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 513A5160B45; Thu, 5 Jan 2017 21:52:00 +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 99EB7160B26 for ; Thu, 5 Jan 2017 22:51:59 +0100 (CET) Received: (qmail 74175 invoked by uid 500); 5 Jan 2017 21:51:58 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 74120 invoked by uid 99); 5 Jan 2017 21:51:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2017 21:51:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7B56C2C2AB7 for ; Thu, 5 Jan 2017 21:51:58 +0000 (UTC) Date: Thu, 5 Jan 2017 21:51:58 +0000 (UTC) From: "Andrew Wang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (HDFS-9896) WebHDFS API may return invalid JSON MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Jan 2017 21:52:00 -0000 [ https://issues.apache.org/jira/browse/HDFS-9896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Wang reopened HDFS-9896: ------------------------------- > WebHDFS API may return invalid JSON > ----------------------------------- > > Key: HDFS-9896 > URL: https://issues.apache.org/jira/browse/HDFS-9896 > Project: Hadoop HDFS > Issue Type: Bug > Components: webhdfs > Affects Versions: 2.6.0, 2.6.5 > Environment: FreeBSD 10.2 > Reporter: Alexander Shorin > > {code} > >>> import requests > >>> resp = requests.get('http://server:50000/webhdfs/v1/tmp/test/\x00/not_found.txt?op=GETFILESTATUS') > >>> resp.content > '{"RemoteException":{"exception":"FileNotFoundException","javaClassName":"java.io.FileNotFoundException","message":"File does not exist: /tmp/test/\x00/not_found.txt"}}' > >>> resp.json() > Traceback (most recent call last): > File "", line 1, in > File "/home/sandbox/project/venv/lib/python2.7/site-packages/requests/models.py", line 800, in json > self.content.decode(encoding), **kwargs > File "/usr/local/lib/python2.7/json/__init__.py", line 338, in loads > return _default_decoder.decode(s) > File "/usr/local/lib/python2.7/json/decoder.py", line 366, in decode > obj, end = self.raw_decode(s, idx=_w(s, 0).end()) > File "/usr/local/lib/python2.7/json/decoder.py", line 382, in raw_decode > obj, end = self.scan_once(s, idx) > ValueError: Invalid control character at: line 1 column 147 (char 146) > {code} > The null byte {{\x00}} should be encoded according JSON rules as {{\u0000}}. It seems like WebHDFS returns path back as is without any processing breaking the content type. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org