]> git.phdru.name Git - mimedecode.git/commitdiff
Fixed last problems with Python 3
authorOleg Broytman <phd@phdru.name>
Wed, 14 Jun 2017 22:17:25 +0000 (01:17 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 14 Jun 2017 22:17:25 +0000 (01:17 +0300)
ChangeLog
TODO
setup.py
test/expected/msg_26.txt-py3 [new file with mode: 0644]
test/expected/msg_39.txt-py3 [new file with mode: 0644]
test/test_all

index 211c766829ea84189c5eade93d36329f6827063d..e6d5d97e2566e261a47fb9257dc6514748194122 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@ Version 2.8.0 (2017-05-??)
 
    Fix: do not decode bytes to unicode under Python 2.7.
 
+   Fixed last problems with Python 3.
+
 Version 2.7.0 (2017-04-26)
 
    Use m_lib.defenc instead of m_lib; install it from PyPI.
diff --git a/TODO b/TODO
index 8dfe2da88ea7cf0ad57a163b5f15d4f058133647..e9223a104c15ef1d958dd3391964b35565541328 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
-Python 3.
-
-
 tox.
 
 
index e10082566e703ec9fc182c3f7fd1c237ee5f1985..af03bfb188aed60017982c809e1730bfe14a1fc9 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -33,6 +33,11 @@ setup(name = "mimedecode",
         'Programming Language :: Python :: 2',
         'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 2 :: Only',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
+        'Programming Language :: Python :: 3.5',
+        'Programming Language :: Python :: 3.6',
     ],
     py_modules = ['formatparam_27', 'mimedecode_version'],
     scripts = ['mimedecode.py'],
diff --git a/test/expected/msg_26.txt-py3 b/test/expected/msg_26.txt-py3
new file mode 100644 (file)
index 0000000..bf28802
Binary files /dev/null and b/test/expected/msg_26.txt-py3 differ
diff --git a/test/expected/msg_39.txt-py3 b/test/expected/msg_39.txt-py3
new file mode 100644 (file)
index 0000000..5866bf7
--- /dev/null
@@ -0,0 +1,87 @@
+From test Sat Feb  1 00:00:00 2014
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+
+------- =_aaaaaaaaaa0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa1"
+Content-ID: <20592.1022586929.1@example.com>
+
+------- =_aaaaaaaaaa1
+Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1"
+Content-ID: <20592.1022586929.2@example.com>
+
+
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.3@example.com>
+Content-Description: patch1
+Content-Transfer-Encoding: 8bit
+X-MIME-Autoconverted: from base64 to 8bit by test id mimedecode.py
+
+]u
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.4@example.com>
+Content-Description: patch2
+Content-Transfer-Encoding: 8bit
+X-MIME-Autoconverted: from base64 to 8bit by test id mimedecode.py
+
+]u
+------- =_aaaaaaaaaa1--
+
+------- =_aaaaaaaaaa1
+Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1"
+Content-ID: <20592.1022586929.6@example.com>
+
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.7@example.com>
+Content-Description: patch3
+Content-Transfer-Encoding: base64
+
+XXX
+
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.8@example.com>
+Content-Description: patch4
+Content-Transfer-Encoding: base64
+
+XXX
+
+------- =_aaaaaaaaaa1--
+
+------- =_aaaaaaaaaa1
+Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1"
+Content-ID: <20592.1022586929.10@example.com>
+
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.11@example.com>
+Content-Description: patch5
+Content-Transfer-Encoding: base64
+
+XXX
+
+------- =_aaaaaaaaaa1
+Content-Type: application/octet-stream
+Content-ID: <20592.1022586929.12@example.com>
+Content-Description: patch6
+Content-Transfer-Encoding: base64
+
+XXX
+
+------- =_aaaaaaaaaa1--
+
+------- =_aaaaaaaaaa1--
+
+------- =_aaaaaaaaaa0
+Content-ID: <20592.1022586929.15@example.com>
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+X-MIME-Autoconverted: from us-ascii to utf-8 by test id mimedecode.py
+
+--
+It's never too late to have a happy childhood.
+
+------- =_aaaaaaaaaa0--
index b05f3834eb03f335c3b62e828a3576430f5526f7..d5b06e1923b9bc4b1148af56d94d3005bcd086c8 100755 (executable)
@@ -8,11 +8,19 @@ rm -rf save tmp &&
 mkdir tmp || exit 1
 
 RC=0
+if [ `$PYTHON -c "import sys; print(sys.version[0])"` -eq 2 ]; then
+   PY3=NO
+else
+   PY3=YES
+fi
 
 test1() {
    infile="$1"
    shift
    expfile="$1"
+   if [ $PY3 = YES -a -f expected/"$expfile"-py3 ]; then
+      expfile="$expfile"-py3
+   fi
    shift
 
    $PYTHON ../mimedecode.py -H test -f utf-8 "$@" input/"$infile" >tmp/"$expfile" || return 1