diff options
| author | Barry Warsaw | 2011-02-25 18:29:37 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2011-02-25 18:29:37 -0500 |
| commit | 5ba88a817026f19aa4b3866c4b9bf65e7ea3d016 (patch) | |
| tree | bb88f3078a657123043a6c7d6ce85786e4898302 /src/mailman/Utils.py | |
| parent | 713658b0c74ad7b6148aa0282296c66111c0c6c0 (diff) | |
| download | mailman-5ba88a817026f19aa4b3866c4b9bf65e7ea3d016.tar.gz mailman-5ba88a817026f19aa4b3866c4b9bf65e7ea3d016.tar.zst mailman-5ba88a817026f19aa4b3866c4b9bf65e7ea3d016.zip | |
Diffstat (limited to 'src/mailman/Utils.py')
| -rw-r--r-- | src/mailman/Utils.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/mailman/Utils.py b/src/mailman/Utils.py index 18b7a8b95..37dcbe5e6 100644 --- a/src/mailman/Utils.py +++ b/src/mailman/Utils.py @@ -36,8 +36,6 @@ import errno import logging # pylint: disable-msg=E0611,W0403 -from email.errors import HeaderParseError -from email.header import decode_header, make_header from string import ascii_letters, digits, whitespace from zope.component import getUtility @@ -337,18 +335,3 @@ def uquote(s): a.append(c) # Join characters together and coerce to byte string return str(EMPTYSTRING.join(a)) - - -def oneline(s, cset='us-ascii', in_unicode=False): - # Decode header string in one line and convert into specified charset - try: - h = make_header(decode_header(s)) - ustr = h.__unicode__() - line = UEMPTYSTRING.join(ustr.splitlines()) - if in_unicode: - return line - else: - return line.encode(cset, 'replace') - except (LookupError, UnicodeError, ValueError, HeaderParseError): - # possibly charset problem. return with undecoded string in one line. - return EMPTYSTRING.join(s.splitlines()) |
