From dfed6f14d5081d17f9e9bf4d7f2eb6fc6a5bf949 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 15 Jun 2017 01:17:25 +0300 Subject: [PATCH] Fixed last problems with Python 3 --- ChangeLog | 2 + TODO | 3 -- setup.py | 5 ++ test/expected/msg_26.txt-py3 | Bin 0 -> 2021 bytes test/expected/msg_39.txt-py3 | 87 +++++++++++++++++++++++++++++++++++ test/test_all | 8 ++++ 6 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 test/expected/msg_26.txt-py3 create mode 100644 test/expected/msg_39.txt-py3 diff --git a/ChangeLog b/ChangeLog index 211c766..e6d5d97 100644 --- 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 8dfe2da..e9223a1 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,3 @@ -Python 3. - - tox. diff --git a/setup.py b/setup.py index e100825..af03bfb 100755 --- 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 index 0000000000000000000000000000000000000000..bf2880234a3a392432574a073232266b4bfb3c15 GIT binary patch literal 2021 zcma)6Pj3@P6yMfJHtV*i-{8py6x8fycGq_7HLel}ZX;n4;ee>B9>%-lWWc+#-5Go1 z7RkOfQol@YIr!28QZA7=_QY2}zU2Ut`*zoXLMbrv?97|@|M%W=Cl&!HCKdFkf)48g zSU`xI{lF$xRlmdQeVUP+Rc{GNft)^{S^@d4I`xod>;4x!kCe1_$saR|dg-3@v zz*?`nzqjMq#->R&;m*VDyElOQu-)l2?GCZ6Y72U!a2+fgx^#m6hz+FS)@rV^3EvTm z5PgR#=6+bJ?pn2#R0l(Ip+nUni(#J!3~mlG!c<6Xr9rWpvGu{=d!zni z<|!9;yW4v(;6s+-q<5K=^ne+=J1*R;`-6JTcWTwX`EPe|q6~9^k`XEH-SjMkuUx-zp7 zmk{K*0A6_rX*4hpae!Tw9CGgvCSnvrKoQ3nXoP`aXu}Ekf=LL40y&Bz5i3*wNsNH; ztdKGLb;M%^6hfAu-Z)PW#2_~(#Xu!!Y2{*NLT29ALBu)*$&+e2*F5UVm~!^t{O`2^56>V-afL{AE{(=W4A0%Df(fU7i53O*kUSenc#T~pT) zxlbYb$#N-nq&A`<x>+AS?FvNC{7b2#R_$og-;b>2VGiXeONw zXExtBb^(q;h5$38iLUo}5Mfudv?!1u;y{(6-eG{rU>2X1#=AX+bscgq>+p@3OHara zgfw97iiiIQPt1N0t=F4gr3DImvVE(&*V3;J1@+t42ZI4}s{IzQBj&ZQJGGkcSADAm z)bp^l+SjqiFTL$>841brNqQS}D;v}I99G_F?Z-5fSS#aBn0J8-jXqZ&gR@U1t5;Jn zQ^}8Dd8<4AQp?sDziYT*wZG7=;4NQ&f30ches>*f8veB7~xR;rMaxqn3BuSFf#VcriaaGfQu*AU zcB0O5{byM`r6|DwQvO9AZ@KvNY`MUEqAVY6cA}o6#Oohc`IgGXB-u%lOFU4Zh;(#` z*Q`{IFwO#*WdN4YN_l>IO0-gLUq&-zBTxk=J2&Sivy?148C{zGj + +------- =_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-- diff --git a/test/test_all b/test/test_all index b05f383..d5b06e1 100755 --- a/test/test_all +++ b/test/test_all @@ -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 -- 2.39.2