On Tue, Sep 29, 2009 at 12:37 PM, Nicolas M. Thiery <nicolas.thi...@u-psud.fr> wrote: > On Tue, Sep 29, 2009 at 09:36:57AM +0200, Kjell Magne Fauske wrote: >> Thank you Nicolas for chasing down this bug. > > Take it as a self-inflicted punishment for not reading the manual in the > first place :-) > >> I have made the changes >> you suggested: >> http://code.google.com/p/dot2tex/source/detail?r=249 >> I have to test it some more, but could you try the latest version of >> dot2tex.py from trunk to verify that it fixes your problem? >> http://dot2tex.googlecode.com/svn-history/r249/trunk/dot2tex/dot2tex.py > > It does! Thanks! >
Great. I will upload a new bugfix release of dot2tex as soon as possible. > Just wondering about the new version: > > + try: > + data = stdout.read() > + finally: > + stdout.close() > + > + try: > + error_data = stderr.read() > + if error_data: > + log.debug('Graphviz STDERR %s', error_data) > + finally: > + stderr.close() > > Could closing stdout early prevent from reading all the information > from stderr? Also, in case of an exception in the first block, stderr > is not closed, right? Should there be a single try ... finally close? > > Well, again, I am a novice here, and there must be a standard python > mantra for this use case. Googling around, I only found so far: > > http://www.gossamer-threads.com/lists/python/dev/754673 > You are probably right. I'm not satisfied with this part dot2tex. os.popen3 is actually deprecated, so I want to replace it with the subprocress module instead. That will unfortunately break Python 2.3 compatibility. The data from stderr is not used in dot2tex 2.8.6 so I could probably replace it with one of the simpler variants of popen. - Kjell Magne Fauske --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en -~----------~----~----~----~------~----~------~--~---