From b3e22554d7b69f2763bd825aef8ee474f6b4dc2b Mon Sep 17 00:00:00 2001 From: hpk Date: Fri, 17 Apr 2009 13:30:55 +0200 Subject: [PATCH] [svn r64259] porting afa's 64232 and 64253 to trunk --HG-- branch : trunk --- py/path/local/local.py | 2 ++ py/path/local/testing/test_win.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/py/path/local/local.py b/py/path/local/local.py index 57f2e2cdb..4c432d804 100644 --- a/py/path/local/local.py +++ b/py/path/local/local.py @@ -514,6 +514,8 @@ class LocalPath(common.FSPathBase, PlatformMixin): else: if iswin32: paths = py.std.os.environ['Path'].split(';') + if '' not in paths and '.' not in paths: + paths.append('.') try: systemroot = os.environ['SYSTEMROOT'] except KeyError: diff --git a/py/path/local/testing/test_win.py b/py/path/local/testing/test_win.py index 12d6377b6..f9ad92112 100644 --- a/py/path/local/testing/test_win.py +++ b/py/path/local/testing/test_win.py @@ -42,4 +42,15 @@ class TestWINLocalPath: assert t1 == str(self.root) + '\\a_path' t1 = self.root.join('dir/a_path') assert t1 == str(self.root) + '\\dir\\a_path' - + + def test_sysfind_in_currentdir(self): + cmd = py.path.local.sysfind('cmd') + root = cmd.new(dirname='', basename='') # c:\ in most installations + + old = root.chdir() + try: + x = py.path.local.sysfind(cmd.relto(root)) + assert x.check(file=1) + finally: + old.chdir() +