[Mailman-Developers] MM 3 alpha 4: UnicodeWarning

Barry Warsaw barry at python.org
Mon Nov 30 23:56:29 CET 2009


On Nov 30, 2009, at 12:24 PM, Ian Eiloart wrote:

> Error in test test_SMTP32_failure  
> (mailman.tests.test_bounces.BounceTest)
> Traceback (most recent call last):
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/unittest.py", line 279, in run
>   testMethod()
> File "/Users/iane/Downloads •/mailman-3.0.0a4/src/mailman/tests/ 
> test_bounces.py", line 193, in test_SMTP32_failure
>   with open(os.path.join(MSGDIR, 'postfix_01.txt')) as fp:
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/posixpath.py", line 70, in join
>   path += '/' + b
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position  
> 22: ordinal not in range(128)
>
> Error in test test_bounce (mailman.tests.test_bounces.BounceTest)
> Traceback (most recent call last):
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/unittest.py", line 279, in run
>   testMethod()
> File "/Users/iane/Downloads •/mailman-3.0.0a4/src/mailman/tests/ 
> test_bounces.py", line 175, in test_bounce
>   path = os.path.join(MSGDIR, filename)
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/posixpath.py", line 70, in join
>   path += '/' + b
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position  
> 22: ordinal not in range(128)

I think Mark correctly diagnosed the problem.  Keep in mind that these  
are somewhat broken tests anyway because they should be using  
pkg_resource to get at those files instead of os.path.join() and  
open().  I don't know if that'll solve the problem though.

I'm not exactly sure how to fix this yet, but I'll try to see if I can  
reproduce it locally.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20091130/25a57c4f/attachment-0001.pgp>


More information about the Mailman-Developers mailing list