Gives the same errors when using --encoding† ascii; --encoding utf8; as well as using rst2latex.py and rst2html.py

Paul

On Wed, Oct 3, 2012 at 3:33 PM, Guenter Milde <milde@users.sf.net> wrote:
On 2012-10-02, Paul Tremblay wrote:
> On Tue, Oct 2, 2012 at 5:23 AM, Guenter Milde <milde@users.sf.net> wrote:
>> On 2012-10-02, Paul Tremblay wrote:

>> > †I'm on sourceforge. This email comes from Darwin, but I ran the code on
>> > Windows. I removed all the previous versions to make sure and then
>> > downloaded the newest snapshot:

>> > cd docutils
>> > python setup.py install
>> > cd test
>> > rst2xml.py --traceback †data/latin1.txt

>> > Traceback (most recent call last):
>> > † File "c:/Python32/Scripts/rst2xml.py", line 23, in <module>
>> > † † publish_cmdline(writer_name='xml', description=description)
>> > † File "c:\Python32\lib\site-packages\docutils\core.py", line 352, in
>> > publish_cmdline
>> > † † config_section=config_section, enable_exit_status=enable_exit_status)
>> > † File "c:\Python32\lib\site-packages\docutils\core.py", line 219, in
>> > publish
>> > † † output = self.writer.write(self.document, self.destination)
>> > † File "c:\Python32\lib\site-packages\docutils\writers\__init__.py", line
>> > 81, in write
>> > † † output = self.destination.write(self.output)
>> > † File "c:\Python32\lib\site-packages\docutils\io.py", line 393, in write
>> > † † self.destination.write(data)
>> > TypeError: 'str' does not support the buffer interface
>> > Exception ValueError: 'I/O operation on closed file.' in
>> <_io.TextIOWrapper
>> > name='<stdout>' mode='w' encoding='cp437'> ignored

>> > BUT:

>> > rst2xml.py --output-encoding cp437 data/latin1.txt

>> > gives no error.

How about

† rst2xml.py --output-encding ascii data/latin1.txt
† rst2xml.py --output-encding utf8 †data/latin1.txt

Does the locale setting influence the result?

>> > TypeError: 'str' does not support the buffer interface

>> was caused by the "wrong" use of binary vs. unicode strings and also
>> http://www.jeetworks.org/node/67 seems to suggest that this "cryptic"
>> message points to such a problem.

Does the same problem also happen with other frontends (rst2html,
rst2latex, ...)

I cannot do any testing, as I don't have access to a windows PC.

GŁnter



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Docutils-develop mailing list
Docutils-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-develop

Please use "Reply All" to reply to the list.