Myself and Eric Faurot have recently ported PyX to OpenBSD. This was mostly a simple affair, but there is one serious bug in PyX 0.10 which causes frequent crashes when calling TeX. Eric has spent some time tracking this down, and has resolved the problem on OpenBSD. In Eric's words this was due to "an interrupted read, and a thread starting too early". Since there's nothing obviously OpenBSD-looking about his patch, I am hopeful that it will not impact on other platforms.
As a much more minor patch, one of the example programs included with PyX doesn't appear to work, so a small commenting out of the offending part makes things work again. Please find both patches at the end of this mail. It would be great if they could be included in the next version of PyX! Laurie -- http://tratt.net/laurie/ -- Personal http://convergepl.org/ -- The Converge programming language --- pyx/text.py.orig Fri Jul 20 17:18:31 2007 +++ pyx/text.py Fri Nov 30 17:39:37 2007 @@ -620,11 +620,17 @@ class _readpipe(threading.Thread): self.gotqueue = gotqueue self.quitevent = quitevent self.expect = None - self.start() def run(self): """thread routine""" - read = self.pipe.readline() # read, what comes in + def _read(): + while 1: + try: + return self.pipe.readline() + except IOError, e: + if e.errno not in (4, ): # interrupted + raise + read = _read() # read, what comes in try: self.expect = self.expectqueue.get_nowait() # read, what should be expected except Queue.Empty: @@ -636,7 +642,7 @@ class _readpipe(threading.Thread): self.gotqueue.put(read) # report, whats read if self.expect is not None and read.find(self.expect) != -1: self.gotevent.set() # raise the got event, when the output was expected (XXX: within a single line) - read = self.pipe.readline() # read again + read = _read() # read again try: self.expect = self.expectqueue.get_nowait() except Queue.Empty: @@ -899,6 +905,7 @@ class texrunner: self.fontmap = dvifile.readfontmap(self.fontmaps.split()) oldpreamblemode = self.preamblemode self.preamblemode = 1 + self.readoutput.start() self.execute("\\scrollmode\n\\raiseerror%\n" # switch to and check scrollmode "\\def\\PyX{P\\kern-.3em\\lower.5ex\hbox{Y}\kern-.18em X}%\n" # just the PyX Logo "\\gdef\\PyXBoxHAlign{0}%\n" # global PyXBoxHAlign (0.0-1.0) for the horizontal alignment, default to 0 --- examples/bargraphs/months.py.orig Fri Nov 30 18:03:54 2007 +++ examples/bargraphs/months.py Fri Nov 30 18:03:43 2007 @@ -1,4 +1,4 @@ -bap = graph.axis.painter.bar -a = graph.axis.nestedbar(painter=bap(nameattrs=[trafo.rotate(45), - text.halign.right], - innerticklength=0.1)) +#bap = graph.axis.painter.bar +#a = graph.axis.nestedbar(painter=bap(nameattrs=[trafo.rotate(45), +# text.halign.right], +# innerticklength=0.1)) ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
