diff options
author | Kai Kang <kai.kang@windriver.com> | 2014-10-29 19:16:08 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-04 10:27:11 +0000 |
commit | 72964fca1d044fbb49ae64c4bab3145e32240c9f (patch) | |
tree | 61ce03b4b386da909ea515cebe9b114cd7f307e5 /meta | |
parent | d6fd3030f98eaf3da3a71f723361ac0f7f94c8dd (diff) | |
download | poky-72964fca1d044fbb49ae64c4bab3145e32240c9f.tar.gz |
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.
(From OE-Core rev: c51caffe5ac0d49844dcbac7967f609d44c20470)
Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/python/python/remove-BOM-insection-code.patch | 24 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.3.bb | 1 |
2 files changed, 25 insertions, 0 deletions
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 0000000000..3462620917 --- /dev/null +++ b/meta/recipes-devtools/python/python/remove-BOM-insection-code.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | # HG changeset patch | ||
2 | # User Vinay Sajip <vinay_sajip@yahoo.co.uk> | ||
3 | # Date 1334583503 -3600 | ||
4 | # Node ID af46a001d5eca99a7ff44ed18256c235c5c3f1d0 | ||
5 | # Parent 33bc53e0aa9ea42c6a6bb077d182e62c8c569aa1 | ||
6 | Issue #14452: remove BOM insertion code. | ||
7 | |||
8 | Backport from https://hg.python.org/cpython/rev/af46a001d5ec. | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
12 | --- | ||
13 | diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py | ||
14 | --- a/Lib/logging/handlers.py | ||
15 | +++ b/Lib/logging/handlers.py | ||
16 | @@ -821,8 +821,6 @@ class SysLogHandler(logging.Handler): | ||
17 | # Message is a string. Convert to bytes as required by RFC 5424 | ||
18 | if type(msg) is unicode: | ||
19 | msg = msg.encode('utf-8') | ||
20 | - if codecs: | ||
21 | - msg = codecs.BOM_UTF8 + msg | ||
22 | msg = prio + msg | ||
23 | try: | ||
24 | 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 cc92ebc6a4..f2e6fde4d6 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 += "\ | |||
38 | file://python-2.7.3-CVE-2014-1912.patch \ | 38 | file://python-2.7.3-CVE-2014-1912.patch \ |
39 | file://json-flaw-fix.patch \ | 39 | file://json-flaw-fix.patch \ |
40 | file://posix_close.patch \ | 40 | file://posix_close.patch \ |
41 | file://remove-BOM-insection-code.patch \ | ||
41 | " | 42 | " |
42 | 43 | ||
43 | S = "${WORKDIR}/Python-${PV}" | 44 | S = "${WORKDIR}/Python-${PV}" |