5b1c8caa82d1924be9c2ec82a3b5d27182ed52ab max Tue Jul 4 06:03:58 2023 -0700 sys.stdout.buffer is not actually needed here, trying to avoid using buffer and using the normal buffered stdout instead, refs #31563 diff --git src/hg/hgGeneGraph/hgGeneGraph src/hg/hgGeneGraph/hgGeneGraph index 34adb6a..8da2754 100755 --- src/hg/hgGeneGraph/hgGeneGraph +++ src/hg/hgGeneGraph/hgGeneGraph @@ -1211,36 +1211,32 @@ # text above graph print("Mouse over or click genes or lines for details. Dashed lines indicate interactions without text mining support. ") print("Click any gene to make it the new center. Click any line to show details about the interaction. ") print(("Only %s-interacting genes and only the most-mentioned/most-curated interactions are shown in the graph. " % (targetGene))) print("See the Help Page for details.
") # menu above graph # background #fffef5 would be an alternive print('
') printGraphMenu(conn, targetGene, addNeighbors) print("

") # graph itself print('' % picName) - mapData = open(mapName, "rb").read() - # the data in the graphviz map file seems to be sometimes utf8 and sometimes other codepages (not latin1). So passing it through as a byte string - # to the byte-buffer underneath sys.stdout. I have not found another way to make this work. Not sure why web browsers can show it just fine. - sys.stdout.flush() - sys.stdout.buffer.write(mapData) - sys.stdout.flush() + mapData = open(mapName, "rt", encoding="latin1").read() + sys.stdout.write(mapData) print('

') print("

") def printPmidSearchForm(): " print a little form that allows to search for a PMID " print("


") print("Search for a PMID: ") print('
') print(' ') print(' ') print('

') def printDisclaimer(): print('''