You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/06 12:12:06 UTC

[incubator-ponymail-foal] branch master updated (5b802b7 -> f57702e)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from 5b802b7  fix scope of variable, so it's accessible in later evals
     new bd17e22  Elaborate on message body encoding hack.
     new f57702e  This var is unused outside of this scope.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/archiver.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


[incubator-ponymail-foal] 01/02: Elaborate on message body encoding hack.

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit bd17e22b0b9030d2736bb8759f0a7e4414d85773
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Sep 6 14:10:16 2020 +0200

    Elaborate on message body encoding hack.
---
 tools/archiver.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 285032c..8148e54 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -201,9 +201,11 @@ class Body:
                     if valid_encodings:
                         self.character_set = "us-ascii"
                 except UnicodeDecodeError:
-                    # If us-ascii strict fails, it's probably undeclared UTF-8.
+                    # If us-ascii strict fails, it's probably undeclared UTF-8 (it happens!).
                     # Set the .string, but not a character set, as we don't know it for sure.
-                    # This is mainly so the older generators won't barf.
+                    # This is mainly so the older generators won't barf, as the generator will
+                    # be fed the message body as a bytes object if no encoding is set, while
+                    # the resulting metadoc will always use the string version.
                     self.string = self.bytes.decode("utf-8", "replace")
 
     def __repr__(self):


[incubator-ponymail-foal] 02/02: This var is unused outside of this scope.

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit f57702eecab09e4cb2a08b83b8416ee4371c40fe
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Sep 6 14:11:56 2020 +0200

    This var is unused outside of this scope.
    
    Doesn't seem to be needed, as character_set is just as good a test
---
 tools/archiver.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 8148e54..c92d3c5 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -177,7 +177,6 @@ class Body:
                 parent_charset
             )  # Parent charset as fallback if any/different
         self.character_set = None
-        self.has_charset = False
         self.string: typing.Optional[str] = None
         self.flowed = "format=flowed" in part.get("content-type", "")
         self.bytes = part.get_payload(decode=True)
@@ -189,7 +188,6 @@ class Body:
                     try:
                         self.string = self.bytes.decode(cs)
                         self.character_set = str(cs)
-                        self.has_charset = True
                         break
                     except UnicodeDecodeError:
                         pass