[oe-commits] Kai Kang : python-2.7.3:remove BOM insertion code
git at git.openembedded.org
git at git.openembedded.org
Tue Nov 4 10:28:59 UTC 2014
Module: openembedded-core.git
Branch: master
Commit: c51caffe5ac0d49844dcbac7967f609d44c20470
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c51caffe5ac0d49844dcbac7967f609d44c20470
Author: Kai Kang <kai.kang at windriver.com>
Date: Wed Oct 29 19:16:08 2014 +0800
python-2.7.3:remove BOM insertion code
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 at windriver.com>
Signed-off-by: Kai Kang <kai.kang at windriver.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
.../python/python/remove-BOM-insection-code.patch | 24 ++++++++++++++++++++++
meta/recipes-devtools/python/python_2.7.3.bb | 1 +
2 files changed, 25 insertions(+)
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..3462620
--- /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 at 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: Backport
+Signed-off-by: Kai Kang <kai.kang at 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}"
More information about the Openembedded-commits
mailing list