Re: Test fixture failure zope.interface under Python 3.1

Jens Vagelpohl <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
-----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 <[email protected]> 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-----
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.