From: Kang Kai <Kai.Kang@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2] python-2.7.3:remove BOM insertion code
Date: Wed, 29 Oct 2014 19:15:28 +0800 [thread overview]
Message-ID: <5450CC50.1040809@windriver.com> (raw)
In-Reply-To: <1414580771-32464-2-git-send-email-kai.kang@windriver.com>
On 2014年10月29日 19:06, Kai Kang wrote:
> Backport patch from:
> https://hg.python.org/cpython/rev/af46a001d5ec
>
> SysLogHandler converts message to utf8 and adds BOM, supposedly
> to conform with RFC5424, but the implementation is broken:
> the RFC specifies that the BOM should prefix only unstructured
> message part, but current Python implementation puts it in the
> middle of structured part, thus confusing RFC-compliant receivers.
>
> Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
> .../python/python/remove-BOM-insection-code.patch | 24 ++++++++++++++++++++++
> meta/recipes-devtools/python/python_2.7.3.bb | 1 +
> 2 files changed, 25 insertions(+)
> create mode 100644 meta/recipes-devtools/python/python/remove-BOM-insection-code.patch
>
> diff --git a/meta/recipes-devtools/python/python/remove-BOM-insection-code.patch b/meta/recipes-devtools/python/python/remove-BOM-insection-code.patch
> new file mode 100644
> index 0000000..6c96e30
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python/remove-BOM-insection-code.patch
> @@ -0,0 +1,24 @@
> +# HG changeset patch
> +# User Vinay Sajip <vinay_sajip@yahoo.co.uk>
> +# Date 1334583503 -3600
> +# Node ID af46a001d5eca99a7ff44ed18256c235c5c3f1d0
> +# Parent 33bc53e0aa9ea42c6a6bb077d182e62c8c569aa1
> +Issue #14452: remove BOM insertion code.
> +
> +Backport from https://hg.python.org/cpython/rev/af46a001d5ec.
> +
> +Upstream-Status: Pending
Oops. Please ignore this thread. V2 will be sent.
--Kai
> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +---
> +diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
> +--- a/Lib/logging/handlers.py
> ++++ b/Lib/logging/handlers.py
> +@@ -821,8 +821,6 @@ class SysLogHandler(logging.Handler):
> + # Message is a string. Convert to bytes as required by RFC 5424
> + if type(msg) is unicode:
> + msg = msg.encode('utf-8')
> +- if codecs:
> +- msg = codecs.BOM_UTF8 + msg
> + msg = prio + msg
> + try:
> + if self.unixsocket:
> diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb
> index cc92ebc..f2e6fde 100644
> --- a/meta/recipes-devtools/python/python_2.7.3.bb
> +++ b/meta/recipes-devtools/python/python_2.7.3.bb
> @@ -38,6 +38,7 @@ SRC_URI += "\
> file://python-2.7.3-CVE-2014-1912.patch \
> file://json-flaw-fix.patch \
> file://posix_close.patch \
> + file://remove-BOM-insection-code.patch \
> "
>
> S = "${WORKDIR}/Python-${PV}"
--
Regards,
Neil | Kai Kang
next prev parent reply other threads:[~2014-10-29 11:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 11:06 [PATCH 1/2] beecrpty: add option --with-dev-dsp Kai Kang
2014-10-29 11:06 ` [PATCH 2/2] python-2.7.3:remove BOM insertion code Kai Kang
2014-10-29 11:15 ` Kang Kai [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-10-29 11:16 [PATCH 0/2] V2: patches for python and beecrypt Kai Kang
2014-10-29 11:16 ` [PATCH 2/2] python-2.7.3:remove BOM insertion code Kai Kang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5450CC50.1040809@windriver.com \
--to=kai.kang@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox