[Zope-dev] Test fixture failure zope.interface under Python 3.1

Jens Vagelpohl jens at dataflake.org
Sun May 2 16:35:06 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/2/10 21:30 , Lennart Regebro wrote:
> On Sun, May 2, 2010 at 18:37, Jens Vagelpohl <jens at dataflake.org> wrote:
>> The issue is a non-ASCII character in the Changelog:
>>
>> <snip>
>> - - Added support for Python 3.1. Contributors:
>>
>>    Lennart Regebro
>>    Martin v Löwis
>>    Thomas Lotze
>>    Wolfgang Schnerring
>> </snip>
>>
>> Removing the "ö" I can run the tests and buildout. Question: Is this an
>> issue with my particular sandbox? The Python 3.1 I use is a fresh build
>> and I don't manipulate the default encoding anywhere.
> 
> Hmm, I do not get that issue, but maybe the default encoding is
> different on different systems? What are you using?

This is on OS X 10.6.3 and sys.getdefaultencoding says UTF-8. It seems
that the call opening the file ends up with a file handle that assumes
the file contains ASCII:

(Pdb) p open(os.path.join(os.path.dirname(__file__), *rnames))
<_io.TextIOWrapper name='CHANGES.txt' encoding='US-ASCII'>

A little digging[1] tells me the determining factor for this assumed
encoding is the return value of locale.getpreferredencoding, which for
me is ASCII:

>>> locale.getpreferredencoding()
'US-ASCII'

What does your system say?

jens

[1] http://docs.python.org/py3k/library/functions.html#open
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkvd4foACgkQRAx5nvEhZLKmgACfR97RYPAk5bL8AHDUOrkZoZZO
AFUAoIeXrs2DvQ4cusPOOYjFeTckujbS
=m2pV
-----END PGP SIGNATURE-----


More information about the Zope-Dev mailing list