From: Guenter M. <mi...@us...> - 2011-07-07 07:04:12
|
On 2011-07-06, Arfrever Frehtes Taifersar Arahesis wrote: > 2011-07-06 21:10:32 Guenter Milde napisał(a): >> On 2011-07-06, Arfrever Frehtes Taifersar Arahesis wrote: >> > 2011-07-06 09:12:36 Guenter Milde napisał(a): >> >> On 2011-07-05, Arfrever Frehtes Taifersar Arahesis wrote: >> >> > This ignored exception occurs only with Python 3 (even without '> >> >> > /dev/null'). I use Docutils trunk r7071. >> >> > $ touch test.rst $ rst2html.py-2.7 test.rst > /dev/null $ >> >> > rst2html.py-3.2 test.rst > /dev/null Exception ValueError: 'I/O >> >> > operation on closed file.' in <_io.TextIOWrapper name='<stdout>' >> >> > mode='w' encoding='UTF-8'> ignored > Apparently docutils.io.FileOutput.close() closes sys.stdout: > def close(self): > self.destination.close() > self.opened = False > self.destination == sys.stdout This should normally not be called if self.destination is sys.stdout, however, I could reproduce the error. I added an ``if`` so that docutils.io classes never close sys.std(in|out|err). Does this help? Günter |