--- /home/dgingrich/src/python_tools/PyX-0.10/pyx/pykpathsea/__init__.py 2006-09-22 03:10:49.000000000 -0400 +++ /c/Python25/Lib/site-packages/pyx/pykpathsea/__init__.py 2009-01-09 21:20:26.349354600 -0500 @@ -20,16 +20,21 @@ # along with PyX; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - try: from _pykpathsea import * except: - import os + from subprocess import Popen, PIPE find_file_cache = {} def find_file(filename, kpse_file_format): + # 2009-01-08: DAG: edits to allow working with cygwin tex but windows + # python. Replaced os.popen with subprocess.Popen and added call to + # "cygpath -w" command = 'kpsewhich --format="%s" %s' % (kpse_file_format, filename) if not find_file_cache.has_key(command): - find_file_cache[command] = os.popen(command, "r").readline().strip() + path = Popen(command, stdout=PIPE).communicate()[0].strip() + if path: + path = Popen('cygpath -w %s' % path, stdout=PIPE).communicate()[0].strip() + find_file_cache[command] = path return find_file_cache[command] kpse_gf_format = "gf" kpse_pk_format = "pk"