[Testbot] Plone 4.3 - Python 2.6 - Build # 2636 - Still failing! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Fri Jan 23 08:11:05 UTC 2015


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 2636 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/2636/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.textfield
Branch: refs/heads/master
Date: 2015-01-22T20:44:38+02:00
Author: Asko Soukka (datakurre) <asko.soukka at iki.fi>
Commit: https://github.com/plone/plone.app.textfield/commit/d44e18619c20cc5822604ee9569960ba26480536

Fix marshaler decode to decode raw value as unicode (IText)

Files changed:
M docs/HISTORY.rst
M plone/app/textfield/marshaler.py
M plone/app/textfield/marshaler.rst

diff --git a/docs/HISTORY.rst b/docs/HISTORY.rst
index 7da4a34..4fae0b8 100644
--- a/docs/HISTORY.rst
+++ b/docs/HISTORY.rst
@@ -4,6 +4,20 @@ Changelog
 1.2.5 (unreleased)
 ------------------
 
+- Fix marshaler decode to always decode raw value into unicode
+  [datakurre]
+
+- Remove utils.getSiteEncoding, which was deprecated and not used anywhere.
+  [thet]
+
+- For Plone 5, support getting markup control panel settings from the registry,
+  while still supporting normal portal_properties access for Plone < 5.
+  [thet]
+
+- Resolved an interesting circular import case, which wasnt effective because
+  of sort order of imports
+  [thet]
+
 - For Plone 5, support getting markup control panel settings from the registry,
   while still supporting normal portal_properties access for Plone < 5.
   [thet]
diff --git a/plone/app/textfield/marshaler.py b/plone/app/textfield/marshaler.py
index 482647e..baf0bdb 100644
--- a/plone/app/textfield/marshaler.py
+++ b/plone/app/textfield/marshaler.py
@@ -32,8 +32,12 @@ def decode(
                 charset='utf-8',
                 contentType=None,
                 primary=False):
+            try:
+                unicode_value = value.decode(charset)
+            except UnicodeEncodeError:
+                unicode_value = value  # was already unicode
             return RichTextValue(
-                raw=value,
+                raw=unicode_value,
                 mimeType=contentType or self.field.default_mime_type,
                 outputMimeType=self.field.output_mime_type,
                 encoding=charset
diff --git a/plone/app/textfield/marshaler.rst b/plone/app/textfield/marshaler.rst
index a7c7cb8..1f6ee3d 100644
--- a/plone/app/textfield/marshaler.rst
+++ b/plone/app/textfield/marshaler.rst
@@ -53,7 +53,7 @@ We can now look up and test the marshaler:
     'Some \xc3\x98 plain text'
     >>> decoded = marshaler.decode('Some \xc3\x98 plain text', charset='utf-8', contentType='text/plain')
     >>> decoded.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> decoded.mimeType
     'text/plain'
     >>> decoded.outputMimeType
@@ -72,7 +72,7 @@ default type is used.
 
     >>> decoded = marshaler.decode('Some \xc3\x98 plain text')
     >>> decoded.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> decoded.mimeType
     'text/plain'
     >>> decoded.outputMimeType
@@ -108,7 +108,7 @@ Let's now use this message to construct a new object.
     >>> from plone.rfc822 import initializeObjectFromSchema
     >>> initializeObjectFromSchema(newContent, ITestContent, inputMessage)
     >>> newContent._text.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> newContent._text.mimeType
     'text/plain'
     >>> newContent._text.outputMimeType


Repository: plone.app.textfield
Branch: refs/heads/master
Date: 2015-01-23T08:32:50+01:00
Author: Timo Stollenwerk (tisto) <tisto at plone.org>
Commit: https://github.com/plone/plone.app.textfield/commit/2235261859c7ce8e00eb9934c09eb23695915590

Merge pull request #15 from plone/datakurre-fix-decode

Fix marshaler decode to decode raw value as unicode (IText)

Files changed:
M docs/HISTORY.rst
M plone/app/textfield/marshaler.py
M plone/app/textfield/marshaler.rst

diff --git a/docs/HISTORY.rst b/docs/HISTORY.rst
index 7da4a34..4fae0b8 100644
--- a/docs/HISTORY.rst
+++ b/docs/HISTORY.rst
@@ -4,6 +4,20 @@ Changelog
 1.2.5 (unreleased)
 ------------------
 
+- Fix marshaler decode to always decode raw value into unicode
+  [datakurre]
+
+- Remove utils.getSiteEncoding, which was deprecated and not used anywhere.
+  [thet]
+
+- For Plone 5, support getting markup control panel settings from the registry,
+  while still supporting normal portal_properties access for Plone < 5.
+  [thet]
+
+- Resolved an interesting circular import case, which wasnt effective because
+  of sort order of imports
+  [thet]
+
 - For Plone 5, support getting markup control panel settings from the registry,
   while still supporting normal portal_properties access for Plone < 5.
   [thet]
diff --git a/plone/app/textfield/marshaler.py b/plone/app/textfield/marshaler.py
index 482647e..baf0bdb 100644
--- a/plone/app/textfield/marshaler.py
+++ b/plone/app/textfield/marshaler.py
@@ -32,8 +32,12 @@ def decode(
                 charset='utf-8',
                 contentType=None,
                 primary=False):
+            try:
+                unicode_value = value.decode(charset)
+            except UnicodeEncodeError:
+                unicode_value = value  # was already unicode
             return RichTextValue(
-                raw=value,
+                raw=unicode_value,
                 mimeType=contentType or self.field.default_mime_type,
                 outputMimeType=self.field.output_mime_type,
                 encoding=charset
diff --git a/plone/app/textfield/marshaler.rst b/plone/app/textfield/marshaler.rst
index a7c7cb8..1f6ee3d 100644
--- a/plone/app/textfield/marshaler.rst
+++ b/plone/app/textfield/marshaler.rst
@@ -53,7 +53,7 @@ We can now look up and test the marshaler:
     'Some \xc3\x98 plain text'
     >>> decoded = marshaler.decode('Some \xc3\x98 plain text', charset='utf-8', contentType='text/plain')
     >>> decoded.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> decoded.mimeType
     'text/plain'
     >>> decoded.outputMimeType
@@ -72,7 +72,7 @@ default type is used.
 
     >>> decoded = marshaler.decode('Some \xc3\x98 plain text')
     >>> decoded.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> decoded.mimeType
     'text/plain'
     >>> decoded.outputMimeType
@@ -108,7 +108,7 @@ Let's now use this message to construct a new object.
     >>> from plone.rfc822 import initializeObjectFromSchema
     >>> initializeObjectFromSchema(newContent, ITestContent, inputMessage)
     >>> newContent._text.raw
-    'Some \xc3\x98 plain text'
+    u'Some \xd8 plain text'
     >>> newContent._text.mimeType
     'text/plain'
     >>> newContent._text.outputMimeType




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 6454 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20150123/1074e055/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 189378 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20150123/1074e055/attachment-0003.obj>


More information about the Testbot mailing list